Skip to content

Commit

Permalink
Avoid a read off-by-one error for UTF16 names in RAR archives.
Browse files Browse the repository at this point in the history
Reported-By: OSS-Fuzz issue 573
  • Loading branch information
jsonn committed Sep 9, 2017
1 parent add25e4 commit 5562545
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libarchive/archive_read_support_format_rar.c
Expand Up @@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
return (ARCHIVE_FATAL);
}
filename[filename_size++] = '\0';
filename[filename_size++] = '\0';
/*
* Do not increment filename_size here as the computations below
* add the space for the terminating NUL explicitly.
*/
filename[filename_size] = '\0';

/* Decoded unicode form is UTF-16BE, so we have to update a string
* conversion object for it. */
Expand Down

1 comment on commit 5562545

@carnil
Copy link

@carnil carnil commented on 5562545 Sep 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue fixed by this commit was assigned CVE-2017-14502

Please sign in to comment.