Fossil SCM
Fix NULL pointer dereference introduced by check-in [b05a6c6bc826d3c2]. Fix for the problem reported by [forum:/forumpost/bfb99db2886ca3b5|forum post/bfb99db2886ca3b5].
Commit
c68fa2edd76d9008b49d58170f565e99ec6b2f9c219330052fa003d092f613fa
Parent
0833f7225b3d6c9…
1 file changed
+5
-3
+5
-3
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -770,13 +770,15 @@ | ||
| 770 | 770 | Th_Store("home", g.zTop); |
| 771 | 771 | Th_Store("index_page", db_get("index-page","/home")); |
| 772 | 772 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 773 | 773 | Th_Store("current_page", local_zCurrentPage); |
| 774 | 774 | /* store the first segment of a path; make a temporary cut if necessary */ |
| 775 | - if(( zSlash = strchr(g.zPath,'/') )) *zSlash = 0; | |
| 776 | - Th_Store("requested_page", escape_quotes(g.zPath)); | |
| 777 | - if( zSlash ) *zSlash = '/'; | |
| 775 | + if( g.zPath && (zSlash = strchr(g.zPath,'/'))!=0 ){ | |
| 776 | + *zSlash = 0; | |
| 777 | + Th_Store("requested_page", escape_quotes(g.zPath)); | |
| 778 | + *zSlash = '/'; | |
| 779 | + } | |
| 778 | 780 | Th_Store("canonical_page", escape_quotes(g.zPhase+1)); |
| 779 | 781 | Th_Store("csrf_token", g.zCsrfToken); |
| 780 | 782 | Th_Store("release_version", RELEASE_VERSION); |
| 781 | 783 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 782 | 784 | Th_Store("manifest_date", MANIFEST_DATE); |
| 783 | 785 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -770,13 +770,15 @@ | |
| 770 | Th_Store("home", g.zTop); |
| 771 | Th_Store("index_page", db_get("index-page","/home")); |
| 772 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 773 | Th_Store("current_page", local_zCurrentPage); |
| 774 | /* store the first segment of a path; make a temporary cut if necessary */ |
| 775 | if(( zSlash = strchr(g.zPath,'/') )) *zSlash = 0; |
| 776 | Th_Store("requested_page", escape_quotes(g.zPath)); |
| 777 | if( zSlash ) *zSlash = '/'; |
| 778 | Th_Store("canonical_page", escape_quotes(g.zPhase+1)); |
| 779 | Th_Store("csrf_token", g.zCsrfToken); |
| 780 | Th_Store("release_version", RELEASE_VERSION); |
| 781 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 782 | Th_Store("manifest_date", MANIFEST_DATE); |
| 783 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -770,13 +770,15 @@ | |
| 770 | Th_Store("home", g.zTop); |
| 771 | Th_Store("index_page", db_get("index-page","/home")); |
| 772 | if( local_zCurrentPage==0 ) style_set_current_page("%T", g.zPath); |
| 773 | Th_Store("current_page", local_zCurrentPage); |
| 774 | /* store the first segment of a path; make a temporary cut if necessary */ |
| 775 | if( g.zPath && (zSlash = strchr(g.zPath,'/'))!=0 ){ |
| 776 | *zSlash = 0; |
| 777 | Th_Store("requested_page", escape_quotes(g.zPath)); |
| 778 | *zSlash = '/'; |
| 779 | } |
| 780 | Th_Store("canonical_page", escape_quotes(g.zPhase+1)); |
| 781 | Th_Store("csrf_token", g.zCsrfToken); |
| 782 | Th_Store("release_version", RELEASE_VERSION); |
| 783 | Th_Store("manifest_version", MANIFEST_VERSION); |
| 784 | Th_Store("manifest_date", MANIFEST_DATE); |
| 785 |