Skip to content

Commit 62ae99c

Browse files
committed
Merge pull request #154 from stweil/master
tesseractmain: Fix unterminated string
2 parents 9c13a15 + 03f37c0 commit 62ae99c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

api/tesseractmain.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,11 @@ int main(int argc, char **argv) {
186186
exit(1);
187187
}
188188

189-
char opt1[255], opt2[255];
189+
char opt1[256], opt2[255];
190190
for (arg = 0; arg < argc; arg++) {
191191
if (strcmp(argv[arg], "-c") == 0 && arg + 1 < argc) {
192192
strncpy(opt1, argv[arg + 1], 255);
193+
opt1[255] = '\0';
193194
char *p = strchr(opt1, '=');
194195
if (!p) {
195196
fprintf(stderr, "Missing = in configvar assignment\n");

0 commit comments

Comments
 (0)