Commit 171f2e78 by Ian Lance Taylor

compiler: Don't overwrite memory if an archive has a bad file name.

From-SVN: r209924
parent f66d6bec
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment