libiberty: prevent buffer overflow when decoding user input
libiberty/ * d-demangle.c (dlang_symbol_backref): Ensure strlen of string is less than length computed by dlang_number.
This commit is contained in:
parent
43358e91bd
commit
5481040197
@ -381,7 +381,7 @@ dlang_symbol_backref (string *decl, const char *mangled,
|
||||
|
||||
/* Must point to a simple identifier. */
|
||||
backref = dlang_number (backref, &len);
|
||||
if (backref == NULL)
|
||||
if (backref == NULL || strlen(backref) < len)
|
||||
return NULL;
|
||||
|
||||
backref = dlang_lname (decl, backref, len);
|
||||
|
Loading…
Reference in New Issue
Block a user