From dd4032e515b79347d3e96ee0f1a605eb1fbcd55c Mon Sep 17 00:00:00 2001 From: Null Date: Sun, 31 Dec 2017 16:20:30 +0800 Subject: [PATCH] Fix a heap corruption in add_ocrtext2str (#865) --- src/lib_ccx/ocr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib_ccx/ocr.c b/src/lib_ccx/ocr.c index c1375297..0770825e 100644 --- a/src/lib_ccx/ocr.c +++ b/src/lib_ccx/ocr.c @@ -836,6 +836,7 @@ void add_ocrtext2str(char *dest, char *src, const char *crlf, unsigned crlf_leng if (!char_found) { src = line_scan; } + if (*src == '\0') break; } *dest = *src; src++;