overlay_path: Fix resolution of symbolic link under /sys/

Change-Id: I650e72fb335aa72256d3b129a65c09bbd7cf26d3
Refs: #1463
This commit is contained in:
Ken Sato
2021-03-10 09:57:05 +09:00
committed by Masamichi Takagi
parent 09173d353c
commit 051c0dcdd8
7 changed files with 167 additions and 1 deletions

View File

@ -3498,7 +3498,7 @@ checkexist_resolvelinks:
if (buf[0] == '/') {
/* cannot snprintf from same source and dest */
n = snprintf(tmpbuf2, PATH_MAX, "%s/%s", buf,
linkpath);
linkpath + 1);
if (n >= PATH_MAX)
return in;
strcpy(tmpbuf, tmpbuf2);