Fossil SCM

Fix a potential NULL pointer dereference in search if the search index is not correct.

drh 2024-03-20 19:06 trunk
Commit 11ffd84a9a004512f139c8a68fb0e1d0f05c337f47f475d2c26e8c67ced88368
1 file changed +1 -1
+1 -1
--- src/search.c
+++ src/search.c
@@ -1157,11 +1157,11 @@
11571157
@ <li><p><a href='%R%s(zUrl)'>%h(zLabel)</a>
11581158
if( fDebug ){
11591159
@ (%e(db_column_double(&q,3)), %s(db_column_text(&q,4))
11601160
}
11611161
@ <br><span class='snippet'>%z(cleanSnippet(zSnippet)) \
1162
- if( zDate && zDate[0] && strstr(zLabel,zDate)==0 ){
1162
+ if( zLabel && zDate && zDate[0] && strstr(zLabel,zDate)==0 ){
11631163
@ <small>(%h(zDate))</small>
11641164
}
11651165
@ </span></li>
11661166
if( nLimit && nRow>=nLimit ) break;
11671167
}
11681168
--- src/search.c
+++ src/search.c
@@ -1157,11 +1157,11 @@
1157 @ <li><p><a href='%R%s(zUrl)'>%h(zLabel)</a>
1158 if( fDebug ){
1159 @ (%e(db_column_double(&q,3)), %s(db_column_text(&q,4))
1160 }
1161 @ <br><span class='snippet'>%z(cleanSnippet(zSnippet)) \
1162 if( zDate && zDate[0] && strstr(zLabel,zDate)==0 ){
1163 @ <small>(%h(zDate))</small>
1164 }
1165 @ </span></li>
1166 if( nLimit && nRow>=nLimit ) break;
1167 }
1168
--- src/search.c
+++ src/search.c
@@ -1157,11 +1157,11 @@
1157 @ <li><p><a href='%R%s(zUrl)'>%h(zLabel)</a>
1158 if( fDebug ){
1159 @ (%e(db_column_double(&q,3)), %s(db_column_text(&q,4))
1160 }
1161 @ <br><span class='snippet'>%z(cleanSnippet(zSnippet)) \
1162 if( zLabel && zDate && zDate[0] && strstr(zLabel,zDate)==0 ){
1163 @ <small>(%h(zDate))</small>
1164 }
1165 @ </span></li>
1166 if( nLimit && nRow>=nLimit ) break;
1167 }
1168

Keyboard Shortcuts

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