diff options
author | Ron Yorston <rmy@pobox.com> | 2025-05-19 08:34:32 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2025-05-19 08:34:32 +0100 |
commit | 64bf69893bd99c305d13a956389f216e7d15c682 (patch) | |
tree | 7fa7d449f0633c86c1248c0bb86363dd9f46da38 /archival/libarchive/unsafe_prefix.c | |
parent | a807cdfa95cf4af2f84e207ed15887cc3514cb43 (diff) | |
parent | 5f07327251c93184dfcfc8d978fc35705930ec53 (diff) | |
download | busybox-w32-merge.tar.gz busybox-w32-merge.tar.bz2 busybox-w32-merge.zip |
Merge branch 'busybox' into mergemerge
Diffstat (limited to '')
-rw-r--r-- | archival/libarchive/unsafe_prefix.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/archival/libarchive/unsafe_prefix.c b/archival/libarchive/unsafe_prefix.c index 33e487bf9..667081195 100644 --- a/archival/libarchive/unsafe_prefix.c +++ b/archival/libarchive/unsafe_prefix.c | |||
@@ -14,7 +14,11 @@ const char* FAST_FUNC strip_unsafe_prefix(const char *str) | |||
14 | cp++; | 14 | cp++; |
15 | continue; | 15 | continue; |
16 | } | 16 | } |
17 | if (is_prefixed_with(cp, "/../"+1)) { | 17 | /* We are called lots of times. |
18 | * is_prefixed_with(cp, "../") is slower than open-coding it, | ||
19 | * with minimal code growth (~few bytes). | ||
20 | */ | ||
21 | if (cp[0] == '.' && cp[1] == '.' && cp[2] == '/') { | ||
18 | cp += 3; | 22 | cp += 3; |
19 | continue; | 23 | continue; |
20 | } | 24 | } |