Merge pull request #2612 from AZero13/okay-what

Fatal if field[0].start is null
This commit is contained in:
Tim Kientzle authored and GitHub committed 2025-05-19 19:39:10 -07:00
commit 352b710754
1 file changed
+12 -2
+12 -2
View File
@@ -1185,8 +1185,13 @@ archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text,
/* Set remaining fields to blank. */
for (n = fields; n < numfields; ++n)
field[n].start = field[n].end = NULL;
if (field[0].start == NULL || field[0].end == NULL) {
/* This should never happen */
return (ARCHIVE_FATAL);
}
if (field[0].start != NULL && *(field[0].start) == L'#') {
if (*(field[0].start) == L'#') {
/* Comment, skip entry */
continue;
}
@@ -1676,7 +1681,12 @@ archive_acl_from_text_nl(struct archive_acl *acl, const char *text,
for (n = fields; n < numfields; ++n)
field[n].start = field[n].end = NULL;
if (field[0].start != NULL && *(field[0].start) == '#') {
if (field[0].start == NULL || field[0].end == NULL) {
/* This should never happen */
return (ARCHIVE_FATAL);
}
if (*(field[0].start) == '#') {
/* Comment, skip entry */
continue;
}