mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-02-24 23:34:46 +01:00
bug#2407932: strpbrk() could fail for NULL pointer.
This commit is contained in:
parent
9d317c3794
commit
3b3540d9ef
@ -119,6 +119,8 @@ std::string valueToString( bool value )
|
||||
|
||||
std::string valueToQuotedString( const char *value )
|
||||
{
|
||||
if (value == NULL)
|
||||
return "";
|
||||
// Not sure how to handle unicode...
|
||||
if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL && !containsControlCharacter( value ))
|
||||
return std::string("\"") + value + "\"";
|
||||
|
Loading…
x
Reference in New Issue
Block a user