Fossil SCM
Correct a NULL being passed to strcmp() which caused any submit of JS script code in the skin editor to segfault. Reported in [forum:9d9f0580fd | forum post 9d9f0580fd].
Commit
a88478391e555ed70e1b5342e0712fbfd8d26a1c094dd05ab4d34bc079d40115
Parent
6f70a236ce66fa2…
1 file changed
+1
-1
+1
-1
| --- src/skins.c | ||
| +++ src/skins.c | ||
| @@ -849,11 +849,11 @@ | ||
| 849 | 849 | @ <form action="%R/setup_skinedit" method="post"><div> |
| 850 | 850 | login_insert_csrf_secret(); |
| 851 | 851 | @ <input type='hidden' name='w' value='%d(ii)'> |
| 852 | 852 | @ <input type='hidden' name='sk' value='%d(iSkin)'> |
| 853 | 853 | @ <h2>Edit %s(zTitle):</h2> |
| 854 | - if( P("submit") && cgi_csrf_safe(0) && strcmp(zOrig,zContent)!=0 ){ | |
| 854 | + if( P("submit") && cgi_csrf_safe(0) && (zOrig==0 || strcmp(zOrig,zContent)!=0) ){ | |
| 855 | 855 | db_set_mprintf(zContent, 0, "draft%d-%s",iSkin,zFile); |
| 856 | 856 | } |
| 857 | 857 | @ <textarea name="%s(zFile)" rows="10" cols="80">\ |
| 858 | 858 | @ %h(zContent)</textarea> |
| 859 | 859 | @ <br /> |
| 860 | 860 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -849,11 +849,11 @@ | |
| 849 | @ <form action="%R/setup_skinedit" method="post"><div> |
| 850 | login_insert_csrf_secret(); |
| 851 | @ <input type='hidden' name='w' value='%d(ii)'> |
| 852 | @ <input type='hidden' name='sk' value='%d(iSkin)'> |
| 853 | @ <h2>Edit %s(zTitle):</h2> |
| 854 | if( P("submit") && cgi_csrf_safe(0) && strcmp(zOrig,zContent)!=0 ){ |
| 855 | db_set_mprintf(zContent, 0, "draft%d-%s",iSkin,zFile); |
| 856 | } |
| 857 | @ <textarea name="%s(zFile)" rows="10" cols="80">\ |
| 858 | @ %h(zContent)</textarea> |
| 859 | @ <br /> |
| 860 |
| --- src/skins.c | |
| +++ src/skins.c | |
| @@ -849,11 +849,11 @@ | |
| 849 | @ <form action="%R/setup_skinedit" method="post"><div> |
| 850 | login_insert_csrf_secret(); |
| 851 | @ <input type='hidden' name='w' value='%d(ii)'> |
| 852 | @ <input type='hidden' name='sk' value='%d(iSkin)'> |
| 853 | @ <h2>Edit %s(zTitle):</h2> |
| 854 | if( P("submit") && cgi_csrf_safe(0) && (zOrig==0 || strcmp(zOrig,zContent)!=0) ){ |
| 855 | db_set_mprintf(zContent, 0, "draft%d-%s",iSkin,zFile); |
| 856 | } |
| 857 | @ <textarea name="%s(zFile)" rows="10" cols="80">\ |
| 858 | @ %h(zContent)</textarea> |
| 859 | @ <br /> |
| 860 |