And fix it again.

This commit is contained in:
Miran Grča
2026-02-25 19:51:19 +01:00
committed by GitHub
parent 2b05e0054c
commit 35ab05a0fc

View File

@@ -1032,18 +1032,21 @@ load_image_file(char *dest, char *p, uint8_t *ui_wp)
}
if (strstr(p, "wp://") == p) {
p += 5;
prefix = "wp://";
if (ui_wp != NULL)
*ui_wp = 1;
p += 5;
prefix = "wp://";
if (ui_wp != NULL)
*ui_wp = 1;
} else if ((ui_wp != NULL) && *ui_wp)
prefix = "wp://";
prefix = "wp://";
if (strstr(p, "ioctl://") == p) {
if (strlen(p) > (MAX_IMAGE_PATH_LEN - 11))
ret = 1;
else
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s", p);
if (strlen(p) > (MAX_IMAGE_PATH_LEN - 11))
ret = 1;
else
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s", p);
if (above2 != NULL)
free(above2);
if (above != NULL)
free(above);
@@ -1064,7 +1067,7 @@ load_image_file(char *dest, char *p, uint8_t *ui_wp)
(MAX_IMAGE_PATH_LEN - 11))
ret = 1;
else
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s%s%s", prefix, use, path_get_slash(use), p + strlen("../"));
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s%s%s", prefix, use, path_get_slash(use), p + strlen("../../"));
} else if (memcmp(p, "../", strlen("../")) == 0) {
use = (above == NULL) ? usr_path : above;
if ((strlen(prefix) + strlen(use) + strlen(path_get_slash(use)) + strlen(p + strlen("../"))) >