Fossil SCM

Fix accidental change: make sure that the regexp object has been created prior to using it.

mistachkin 2013-10-15 09:00 UTC tkt-change-hook
Commit 9964af59cea793ee79b067c9519c2b27ba95c2e7
1 file changed +1 -1
+1 -1
--- src/th_main.c
+++ src/th_main.c
@@ -879,11 +879,11 @@
879879
if( zErr ){
880880
Th_SetResult(interp, zErr, -1);
881881
return TH_ERROR;
882882
}
883883
}
884
- if( !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){
884
+ if( !pRe || !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){
885885
Th_SetResult(interp, "url not allowed", -1);
886886
re_free(pRe);
887887
return TH_ERROR;
888888
}
889889
re_free(pRe);
890890
--- src/th_main.c
+++ src/th_main.c
@@ -879,11 +879,11 @@
879 if( zErr ){
880 Th_SetResult(interp, zErr, -1);
881 return TH_ERROR;
882 }
883 }
884 if( !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){
885 Th_SetResult(interp, "url not allowed", -1);
886 re_free(pRe);
887 return TH_ERROR;
888 }
889 re_free(pRe);
890
--- src/th_main.c
+++ src/th_main.c
@@ -879,11 +879,11 @@
879 if( zErr ){
880 Th_SetResult(interp, zErr, -1);
881 return TH_ERROR;
882 }
883 }
884 if( !pRe || !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){
885 Th_SetResult(interp, "url not allowed", -1);
886 re_free(pRe);
887 return TH_ERROR;
888 }
889 re_free(pRe);
890

Keyboard Shortcuts

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