Fossil SCM
Make sure the zOrigName variable in the /doc page implementation is always initialized, even for early errors.
Commit
f5165dd05bb99f6c68594e0e197ec37ae9db5598
Parent
4c247512a8af92b…
1 file changed
+2
-2
+2
-2
| --- src/doc.c | ||
| +++ src/doc.c | ||
| @@ -399,21 +399,21 @@ | ||
| 399 | 399 | }else{ |
| 400 | 400 | zName += i; |
| 401 | 401 | } |
| 402 | 402 | while( zName[0]=='/' ){ zName++; } |
| 403 | 403 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 404 | + zOrigName = zName; | |
| 404 | 405 | if( !file_is_simple_pathname(zName, 1) ){ |
| 405 | 406 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 406 | - zName = mprintf("%sindex.wiki", zName); | |
| 407 | + zOrigName = zName = mprintf("%sindex.wiki", zName); | |
| 407 | 408 | if( !file_is_simple_pathname(zName, 1) ){ |
| 408 | 409 | goto doc_not_found; |
| 409 | 410 | } |
| 410 | 411 | }else{ |
| 411 | 412 | goto doc_not_found; |
| 412 | 413 | } |
| 413 | 414 | } |
| 414 | - zOrigName = zName; | |
| 415 | 415 | if( fossil_strcmp(zCheckin,"ckout")==0 && db_open_local(0)==0 ){ |
| 416 | 416 | sqlite3_snprintf(sizeof(zCheckin), zCheckin, "tip"); |
| 417 | 417 | } |
| 418 | 418 | if( fossil_strcmp(zCheckin,"ckout")==0 ){ |
| 419 | 419 | /* Read from the local checkout */ |
| 420 | 420 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -399,21 +399,21 @@ | |
| 399 | }else{ |
| 400 | zName += i; |
| 401 | } |
| 402 | while( zName[0]=='/' ){ zName++; } |
| 403 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 404 | if( !file_is_simple_pathname(zName, 1) ){ |
| 405 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 406 | zName = mprintf("%sindex.wiki", zName); |
| 407 | if( !file_is_simple_pathname(zName, 1) ){ |
| 408 | goto doc_not_found; |
| 409 | } |
| 410 | }else{ |
| 411 | goto doc_not_found; |
| 412 | } |
| 413 | } |
| 414 | zOrigName = zName; |
| 415 | if( fossil_strcmp(zCheckin,"ckout")==0 && db_open_local(0)==0 ){ |
| 416 | sqlite3_snprintf(sizeof(zCheckin), zCheckin, "tip"); |
| 417 | } |
| 418 | if( fossil_strcmp(zCheckin,"ckout")==0 ){ |
| 419 | /* Read from the local checkout */ |
| 420 |
| --- src/doc.c | |
| +++ src/doc.c | |
| @@ -399,21 +399,21 @@ | |
| 399 | }else{ |
| 400 | zName += i; |
| 401 | } |
| 402 | while( zName[0]=='/' ){ zName++; } |
| 403 | g.zPath = mprintf("%s/%s/%s", g.zPath, zCheckin, zName); |
| 404 | zOrigName = zName; |
| 405 | if( !file_is_simple_pathname(zName, 1) ){ |
| 406 | if( sqlite3_strglob("*/", zName)==0 ){ |
| 407 | zOrigName = zName = mprintf("%sindex.wiki", zName); |
| 408 | if( !file_is_simple_pathname(zName, 1) ){ |
| 409 | goto doc_not_found; |
| 410 | } |
| 411 | }else{ |
| 412 | goto doc_not_found; |
| 413 | } |
| 414 | } |
| 415 | if( fossil_strcmp(zCheckin,"ckout")==0 && db_open_local(0)==0 ){ |
| 416 | sqlite3_snprintf(sizeof(zCheckin), zCheckin, "tip"); |
| 417 | } |
| 418 | if( fossil_strcmp(zCheckin,"ckout")==0 ){ |
| 419 | /* Read from the local checkout */ |
| 420 |