mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-02 19:26:43 +00:00
Fix oob read in types
This commit is contained in:
parent
6870bec29f
commit
551b496a86
@ -109,10 +109,10 @@ static void save_parsed_type(RCore *core, const char *parsed) {
|
||||
char *type = strdup (parsed);
|
||||
if (type) {
|
||||
char *name = NULL;
|
||||
if ((name = strstr(type, "=type")) || (name = strstr(type, "=struct")) || (name = strstr(type, "=union")) ||
|
||||
(name = strstr(type, "=enum")) || (name = strstr(type, "=func"))) {
|
||||
if ((name = strstr (type, "=type")) || (name = strstr (type, "=struct")) || (name = strstr (type, "=union")) ||
|
||||
(name = strstr (type, "=enum")) || (name = strstr (type, "=func"))) {
|
||||
*name = 0;
|
||||
while (*(name - 1) != '\n' && name - 1 >= type) {
|
||||
while (name - 1 >= type && *(name - 1) != '\n') {
|
||||
name--;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user