Skip to content

Commit

Permalink
Fix potential null pointer dereference in ccmain/paragraphs.cpp.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed May 19, 2015
1 parent 05acff6 commit 9328f0e
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 9328f0e

Please sign in to comment.