Fossil SCM

Fixed an out-of-bounds array access in stat.c reported in the forum.

stephan 2020-08-12 09:45 trunk
Commit e70f2fbc7bcdd25ae1543a1e3b385acc729758b1978f886d09a121eff15e3873
1 file changed +1 -1
+1 -1
--- src/stat.c
+++ src/stat.c
@@ -423,11 +423,11 @@
423423
if( dbCheck ){
424424
if( dbCheck<2 ){
425425
char *zRes = db_text(0, "PRAGMA repository.quick_check(1)");
426426
fossil_print("%*s%s\n", colWidth, "database-check:", zRes);
427427
}else{
428
- char *newArgv[2];
428
+ char *newArgv[3];
429429
newArgv[0] = g.argv[0];
430430
newArgv[1] = "test-integrity";
431431
newArgv[2] = 0;
432432
g.argv = newArgv;
433433
g.argc = 2;
434434
--- src/stat.c
+++ src/stat.c
@@ -423,11 +423,11 @@
423 if( dbCheck ){
424 if( dbCheck<2 ){
425 char *zRes = db_text(0, "PRAGMA repository.quick_check(1)");
426 fossil_print("%*s%s\n", colWidth, "database-check:", zRes);
427 }else{
428 char *newArgv[2];
429 newArgv[0] = g.argv[0];
430 newArgv[1] = "test-integrity";
431 newArgv[2] = 0;
432 g.argv = newArgv;
433 g.argc = 2;
434
--- src/stat.c
+++ src/stat.c
@@ -423,11 +423,11 @@
423 if( dbCheck ){
424 if( dbCheck<2 ){
425 char *zRes = db_text(0, "PRAGMA repository.quick_check(1)");
426 fossil_print("%*s%s\n", colWidth, "database-check:", zRes);
427 }else{
428 char *newArgv[3];
429 newArgv[0] = g.argv[0];
430 newArgv[1] = "test-integrity";
431 newArgv[2] = 0;
432 g.argv = newArgv;
433 g.argc = 2;
434

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button