Fossil SCM
s/strcmp/fossil_strcmp/ to avoid a segfault on a NULL string.
Commit
e3a4d954b784d92ebf7ae99075aa49eb70bea138
Parent
9203b4cb1cd1cf2…
1 file changed
+3
-3
+3
-3
| --- src/json_artifact.c | ||
| +++ src/json_artifact.c | ||
| @@ -131,11 +131,11 @@ | ||
| 131 | 131 | zEUser = db_text(0, |
| 132 | 132 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 133 | 133 | TAG_USER, rid); |
| 134 | 134 | if(zEUser){ |
| 135 | 135 | SET("user", json_new_string(zEUser)); |
| 136 | - if(0!=strcmp(zEUser,zUser)){ | |
| 136 | + if(0!=fossil_strcmp(zEUser,zUser)){ | |
| 137 | 137 | SET("originUser",json_new_string(zUser)); |
| 138 | 138 | } |
| 139 | 139 | free(zEUser); |
| 140 | 140 | }else{ |
| 141 | 141 | SET("user",json_new_string(zUser)); |
| @@ -145,11 +145,11 @@ | ||
| 145 | 145 | zEComment = db_text(0, |
| 146 | 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | 147 | TAG_COMMENT, rid); |
| 148 | 148 | if(zEComment){ |
| 149 | 149 | SET("comment",json_new_string(zEComment)); |
| 150 | - if(0 != strcmp(zEComment,zComment)){ | |
| 150 | + if(0 != fossil_strcmp(zEComment,zComment)){ | |
| 151 | 151 | SET("originComment", json_new_string(zComment)); |
| 152 | 152 | } |
| 153 | 153 | free(zEComment); |
| 154 | 154 | }else{ |
| 155 | 155 | SET("comment",json_new_string(zComment)); |
| @@ -470,11 +470,11 @@ | ||
| 470 | 470 | |
| 471 | 471 | handle_entry: |
| 472 | 472 | pay = cson_new_object(); |
| 473 | 473 | assert( (NULL != zType) && "Internal dispatching error." ); |
| 474 | 474 | for( ; dispatcher->name; ++dispatcher ){ |
| 475 | - if(0!=strcmp(dispatcher->name, zType)){ | |
| 475 | + if(0!=fossil_strcmp(dispatcher->name, zType)){ | |
| 476 | 476 | continue; |
| 477 | 477 | }else{ |
| 478 | 478 | entry = (*dispatcher->func)(pay, rid); |
| 479 | 479 | break; |
| 480 | 480 | } |
| 481 | 481 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -131,11 +131,11 @@ | |
| 131 | zEUser = db_text(0, |
| 132 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 133 | TAG_USER, rid); |
| 134 | if(zEUser){ |
| 135 | SET("user", json_new_string(zEUser)); |
| 136 | if(0!=strcmp(zEUser,zUser)){ |
| 137 | SET("originUser",json_new_string(zUser)); |
| 138 | } |
| 139 | free(zEUser); |
| 140 | }else{ |
| 141 | SET("user",json_new_string(zUser)); |
| @@ -145,11 +145,11 @@ | |
| 145 | zEComment = db_text(0, |
| 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | TAG_COMMENT, rid); |
| 148 | if(zEComment){ |
| 149 | SET("comment",json_new_string(zEComment)); |
| 150 | if(0 != strcmp(zEComment,zComment)){ |
| 151 | SET("originComment", json_new_string(zComment)); |
| 152 | } |
| 153 | free(zEComment); |
| 154 | }else{ |
| 155 | SET("comment",json_new_string(zComment)); |
| @@ -470,11 +470,11 @@ | |
| 470 | |
| 471 | handle_entry: |
| 472 | pay = cson_new_object(); |
| 473 | assert( (NULL != zType) && "Internal dispatching error." ); |
| 474 | for( ; dispatcher->name; ++dispatcher ){ |
| 475 | if(0!=strcmp(dispatcher->name, zType)){ |
| 476 | continue; |
| 477 | }else{ |
| 478 | entry = (*dispatcher->func)(pay, rid); |
| 479 | break; |
| 480 | } |
| 481 |
| --- src/json_artifact.c | |
| +++ src/json_artifact.c | |
| @@ -131,11 +131,11 @@ | |
| 131 | zEUser = db_text(0, |
| 132 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 133 | TAG_USER, rid); |
| 134 | if(zEUser){ |
| 135 | SET("user", json_new_string(zEUser)); |
| 136 | if(0!=fossil_strcmp(zEUser,zUser)){ |
| 137 | SET("originUser",json_new_string(zUser)); |
| 138 | } |
| 139 | free(zEUser); |
| 140 | }else{ |
| 141 | SET("user",json_new_string(zUser)); |
| @@ -145,11 +145,11 @@ | |
| 145 | zEComment = db_text(0, |
| 146 | "SELECT value FROM tagxref WHERE tagid=%d AND rid=%d", |
| 147 | TAG_COMMENT, rid); |
| 148 | if(zEComment){ |
| 149 | SET("comment",json_new_string(zEComment)); |
| 150 | if(0 != fossil_strcmp(zEComment,zComment)){ |
| 151 | SET("originComment", json_new_string(zComment)); |
| 152 | } |
| 153 | free(zEComment); |
| 154 | }else{ |
| 155 | SET("comment",json_new_string(zComment)); |
| @@ -470,11 +470,11 @@ | |
| 470 | |
| 471 | handle_entry: |
| 472 | pay = cson_new_object(); |
| 473 | assert( (NULL != zType) && "Internal dispatching error." ); |
| 474 | for( ; dispatcher->name; ++dispatcher ){ |
| 475 | if(0!=fossil_strcmp(dispatcher->name, zType)){ |
| 476 | continue; |
| 477 | }else{ |
| 478 | entry = (*dispatcher->func)(pay, rid); |
| 479 | break; |
| 480 | } |
| 481 |