compiler: Don't overwrite memory if an archive has a bad file name.
From-SVN: r209924
This commit is contained in:
parent
f66d6bec5e
commit
171f2e787d
|
@ -261,7 +261,7 @@ Archive_file::interpret_header(const Archive_header* hdr, off_t off,
|
|||
char size_string[size_string_size + 1];
|
||||
memcpy(size_string, hdr->ar_size, size_string_size);
|
||||
char* ps = size_string + size_string_size;
|
||||
while (ps[-1] == ' ')
|
||||
while (ps > size_string && ps[-1] == ' ')
|
||||
--ps;
|
||||
*ps = '\0';
|
||||
|
||||
|
|
Loading…
Reference in New Issue