Fossil SCM
Fix dereferencing of NULL-pointer in 'pWiki' for the case when non-existent wiki page is requested.
Commit
735a7051f095ca930c276aa6d75ef8f64ec058ff3f9761effee2055261901111
Parent
80e062e1a7fea35…
1 file changed
+6
-5
+6
-5
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -599,16 +599,17 @@ | ||
| 599 | 599 | style_submenu_element("History", "%R/whistory?name=%T", zPageName); |
| 600 | 600 | style_submenu_parametric("wiki",7); |
| 601 | 601 | } |
| 602 | 602 | } |
| 603 | 603 | if( !isPopup ){ |
| 604 | - char *zDate = db_text(0,"SELECT strftime('%%Y-%%m-%%d %%H:%%M'," | |
| 605 | - "'%.17g',toLocal())",pWiki->rDate); | |
| 606 | - Th_Store("wiki_timestamp",zDate); | |
| 607 | - fossil_free( zDate ); | |
| 608 | - Th_Store("wiki_editor",pWiki->zUser); | |
| 609 | 604 | if( zHashsum ){ |
| 605 | + char *zDate = db_text(0,"SELECT strftime('%%Y-%%m-%%d %%H:%%M'," | |
| 606 | + "'%.17g',toLocal())",pWiki->rDate); | |
| 607 | + Th_Store("wiki_timestamp",zDate); | |
| 608 | + fossil_free( zDate ); | |
| 609 | + Th_Store("wiki_editor",pWiki->zUser); | |
| 610 | + | |
| 610 | 611 | Th_Store("artifact_hashsum",zHashsum); |
| 611 | 612 | Th_Store("wiki_hashsum",zHashsum); |
| 612 | 613 | fossil_free( (char*)zHashsum ); |
| 613 | 614 | } |
| 614 | 615 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 615 | 616 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -599,16 +599,17 @@ | |
| 599 | style_submenu_element("History", "%R/whistory?name=%T", zPageName); |
| 600 | style_submenu_parametric("wiki",7); |
| 601 | } |
| 602 | } |
| 603 | if( !isPopup ){ |
| 604 | char *zDate = db_text(0,"SELECT strftime('%%Y-%%m-%%d %%H:%%M'," |
| 605 | "'%.17g',toLocal())",pWiki->rDate); |
| 606 | Th_Store("wiki_timestamp",zDate); |
| 607 | fossil_free( zDate ); |
| 608 | Th_Store("wiki_editor",pWiki->zUser); |
| 609 | if( zHashsum ){ |
| 610 | Th_Store("artifact_hashsum",zHashsum); |
| 611 | Th_Store("wiki_hashsum",zHashsum); |
| 612 | fossil_free( (char*)zHashsum ); |
| 613 | } |
| 614 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 615 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -599,16 +599,17 @@ | |
| 599 | style_submenu_element("History", "%R/whistory?name=%T", zPageName); |
| 600 | style_submenu_parametric("wiki",7); |
| 601 | } |
| 602 | } |
| 603 | if( !isPopup ){ |
| 604 | if( zHashsum ){ |
| 605 | char *zDate = db_text(0,"SELECT strftime('%%Y-%%m-%%d %%H:%%M'," |
| 606 | "'%.17g',toLocal())",pWiki->rDate); |
| 607 | Th_Store("wiki_timestamp",zDate); |
| 608 | fossil_free( zDate ); |
| 609 | Th_Store("wiki_editor",pWiki->zUser); |
| 610 | |
| 611 | Th_Store("artifact_hashsum",zHashsum); |
| 612 | Th_Store("wiki_hashsum",zHashsum); |
| 613 | fossil_free( (char*)zHashsum ); |
| 614 | } |
| 615 | style_set_current_page("%T?name=%T", g.zPath, zPageName); |
| 616 |