mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-02-23 13:21:43 +08:00
demand_copy_C_string NUL check
* read.c (demand_copy_C_string): Really check for embedded zeros.
This commit is contained in:
parent
94ae6062ab
commit
7043388668
@ -1,3 +1,7 @@
|
||||
2021-02-16 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* read.c (demand_copy_C_string): Really check for embedded zeros.
|
||||
|
||||
2021-02-15 Andreas Krebbel <krebbel@linux.ibm.com>
|
||||
|
||||
* config/tc-s390.c (s390_parse_cpu): New entry for arch14.
|
||||
|
@ -5743,12 +5743,12 @@ demand_copy_C_string (int *len_pointer)
|
||||
|
||||
for (len = *len_pointer; len > 0; len--)
|
||||
{
|
||||
if (*s == 0)
|
||||
if (s[len - 1] == 0)
|
||||
{
|
||||
s = 0;
|
||||
len = 1;
|
||||
*len_pointer = 0;
|
||||
as_bad (_("this string may not contain \'\\0\'"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user