mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 08:38:20 +00:00
Fix invalid pointer dereference in AsciiFormatter.
Using a temporary object with strtol() makes the end pointer that it sets invalid after the call.
This commit is contained in:
parent
b6e2505202
commit
c4e8908c8e
1 changed files with 2 additions and 1 deletions
|
@ -247,7 +247,8 @@ threading::Value* AsciiFormatter::ParseValue(string s, string name, TypeTag type
|
|||
goto parse_error;
|
||||
}
|
||||
|
||||
uint8_t width = (uint8_t) strtol(s.substr(pos+1).c_str(), &end, 10);
|
||||
string width_str = s.substr(pos + 1);
|
||||
uint8_t width = (uint8_t) strtol(width_str.c_str(), &end, 10);
|
||||
|
||||
if ( CheckNumberError(s, end) )
|
||||
goto parse_error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue