Skip to content

Commit 731ef02

Browse files
Sergeyhackorum
authored andcommitted
Added an additional check when dereferencing a pointer
1 parent 19733fa commit 731ef02

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/common/jsonapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2574,6 +2574,9 @@ json_errdetail(JsonParseErrorType error, JsonLexContext *lex)
25742574
if (PQExpBufferBroken(lex->errormsg))
25752575
return _("out of memory while constructing error description");
25762576
#endif
2577+
2578+
if (!lex->errormsg)
2579+
return _("out of memory while constructing error description");
25772580

25782581
return lex->errormsg->data;
25792582
}

0 commit comments

Comments
 (0)