Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145956316
D54508.1778979334.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D54508.1778979334.diff
View Options
diff --git a/contrib/libarchive/tar/subst.c b/contrib/libarchive/tar/subst.c
--- a/contrib/libarchive/tar/subst.c
+++ b/contrib/libarchive/tar/subst.c
@@ -237,7 +237,7 @@
char isEnd = 0;
do {
- isEnd = *name == '\0';
+ isEnd = *name == '\0';
if (regexec(&rule->re, name, 10, matches, 0))
break;
@@ -293,13 +293,13 @@
realloc_strcat(result, rule->result + j);
if (matches[0].rm_eo > 0) {
- name += matches[0].rm_eo;
- } else {
- // We skip a character because the match is 0-length
- // so we need to add it to the output
- realloc_strncat(result, name, 1);
- name += 1;
- }
+ name += matches[0].rm_eo;
+ } else if (!isEnd) {
+ // We skip a character because the match is 0-length
+ // so we need to add it to the output
+ realloc_strncat(result, name, 1);
+ name += 1;
+ }
} while (rule->global && !isEnd); // Testing one step after because sed et al. run 0-length patterns a last time on the empty string at the end
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 17, 12:55 AM (13 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28706255
Default Alt Text
D54508.1778979334.diff (1 KB)
Attached To
Mode
D54508: tar: fix off-bounds read resulting from #2787 (3150539ed)
Attached
Detach File
Event Timeline
Log In to Comment