diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-04-30 02:38:30 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-04-30 02:38:30 +0000 |
commit | 171f2e787d4bc1d644acbede5eaf7641ff6a18d6 (patch) | |
tree | e10f61163c44023d0090b288b98d7615472a1517 | |
parent | f66d6bec5ef27297a6e933c50158cfa133b57fa1 (diff) | |
download | gcc-171f2e787d4bc1d644acbede5eaf7641ff6a18d6.zip gcc-171f2e787d4bc1d644acbede5eaf7641ff6a18d6.tar.gz gcc-171f2e787d4bc1d644acbede5eaf7641ff6a18d6.tar.bz2 |
compiler: Don't overwrite memory if an archive has a bad file name.
From-SVN: r209924
-rw-r--r-- | gcc/go/gofrontend/import-archive.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/import-archive.cc b/gcc/go/gofrontend/import-archive.cc index 9a1d5b3..34fb528 100644 --- a/gcc/go/gofrontend/import-archive.cc +++ b/gcc/go/gofrontend/import-archive.cc @@ -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'; |