wmail: fixed possible NULL-pointer dereference in config-parser.
The code calling Tokenize assumed that if it returned true, value would not be NULL. However, in the case of a line containing no equals sign: blah that would not be the case. Changed Tokenize to return false unless id and value are both defined.
This commit is contained in:
parent
40d7eb504c
commit
dbc178ec3f
|
@ -124,6 +124,7 @@ static bool Tokenize( const char *line, const char **id, const char **value )
|
|||
{
|
||||
token2 = strchr( token1, '=' );
|
||||
if( token2 != NULL )
|
||||
{
|
||||
token2 = SkipWhiteSpaces( token2 + 1 );
|
||||
|
||||
if( !IsWhiteSpace( token2 ))
|
||||
|
@ -135,6 +136,7 @@ static bool Tokenize( const char *line, const char **id, const char **value )
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue