mirror of
https://github.com/86Box/86Box.git
synced 2026-02-28 01:44:22 -07:00
And fix it again.
This commit is contained in:
23
src/config.c
23
src/config.c
@@ -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("../"))) >
|
||||
|
||||
Reference in New Issue
Block a user