Fossil SCM
Fix accidental change: make sure that the regexp object has been created prior to using it.
Commit
9964af59cea793ee79b067c9519c2b27ba95c2e7
Parent
348df8f00fd84b4…
1 file changed
+1
-1
+1
-1
| --- src/th_main.c | ||
| +++ src/th_main.c | ||
| @@ -879,11 +879,11 @@ | ||
| 879 | 879 | if( zErr ){ |
| 880 | 880 | Th_SetResult(interp, zErr, -1); |
| 881 | 881 | return TH_ERROR; |
| 882 | 882 | } |
| 883 | 883 | } |
| 884 | - if( !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){ | |
| 884 | + if( !pRe || !re_match(pRe, (const unsigned char *)urlData.canonical, -1) ){ | |
| 885 | 885 | Th_SetResult(interp, "url not allowed", -1); |
| 886 | 886 | re_free(pRe); |
| 887 | 887 | return TH_ERROR; |
| 888 | 888 | } |
| 889 | 889 | re_free(pRe); |
| 890 | 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( !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 |