Skip to content

Commit

Permalink
Fixed a crash when printf() formats are set as 0 (NULL).
Browse files Browse the repository at this point in the history
  • Loading branch information
zik.saleeba committed Aug 30, 2012
1 parent c2fa075 commit 4bc20b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cstdlib/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,16 @@ int StdioBasePrintf(struct ParseState *Parser, FILE *Stream, char *StrOut, int S
{
struct Value *ThisArg = Args->Param[0];
int ArgCount = 0;
char *FPos = Format;
char *FPos;
char OneFormatBuf[MAX_FORMAT+1];
int OneFormatCount;
struct ValueType *ShowType;
StdOutStream SOStream;

if (Format == NULL)
Format = "[null format]\n";

FPos = Format;
SOStream.FilePtr = Stream;
SOStream.StrOutPtr = StrOut;
SOStream.StrOutLen = StrOutLen;
Expand Down

0 comments on commit 4bc20b4

Please sign in to comment.