Skip to content

Commit

Permalink
Merge pull request #32 from orbitcowboy/master
Browse files Browse the repository at this point in the history
 Fix potential null pointer dereference in ccmain/paragraphs.cpp.
  • Loading branch information
zdenop committed May 20, 2015
2 parents 05acff6 + 9328f0e commit f8ebff2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/pdfrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,11 @@ bool TessPDFRenderer::BeginDocumentHandler() {
" /Length1 %ld\n"
">>\n"
"stream\n", size, size);
if (n >= sizeof(buf)) return false;
if (n >= sizeof(buf))
{
delete[] buffer;
return false;
}
AppendString(buf);
objsize = strlen(buf);
AppendData(buffer, size);
Expand Down

0 comments on commit f8ebff2

Please sign in to comment.