Fossil SCM
In parse_mark(), refuse a marks line whose type is neither c nor b, which was taken as a mark with no name, so that fossil export --import-marks no longer crashes on such a line and import no longer accepts it silently.
Commit
ad6172d525212be5d11033f3ec95ef103c3bc8e19e15afe09231125fe2a30d45
Parent
a0871ef274a3799…
1 file changed
+1
-6
+1
-6
| --- src/export.c | ||
| +++ src/export.c | ||
| @@ -309,16 +309,11 @@ | ||
| 309 | 309 | if( !cur_tok || strlen(cur_tok)<2 ){ |
| 310 | 310 | return -1; |
| 311 | 311 | } |
| 312 | 312 | mark->rid = atoi(&cur_tok[1]); |
| 313 | 313 | type_ = cur_tok[0]; |
| 314 | - if( type_!='c' && type_!='b' ){ | |
| 315 | - /* This is probably a blob mark */ | |
| 316 | - mark->name = NULL; | |
| 317 | - return 0; | |
| 318 | - } | |
| 319 | - if( mark->rid<=0 ){ | |
| 314 | + if( (type_!='c' && type_!='b') || mark->rid<=0 ){ | |
| 320 | 315 | return -1; |
| 321 | 316 | } |
| 322 | 317 | |
| 323 | 318 | cur_tok = strtok(NULL, " \t"); |
| 324 | 319 | if( !cur_tok ){ |
| 325 | 320 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -309,16 +309,11 @@ | |
| 309 | if( !cur_tok || strlen(cur_tok)<2 ){ |
| 310 | return -1; |
| 311 | } |
| 312 | mark->rid = atoi(&cur_tok[1]); |
| 313 | type_ = cur_tok[0]; |
| 314 | if( type_!='c' && type_!='b' ){ |
| 315 | /* This is probably a blob mark */ |
| 316 | mark->name = NULL; |
| 317 | return 0; |
| 318 | } |
| 319 | if( mark->rid<=0 ){ |
| 320 | return -1; |
| 321 | } |
| 322 | |
| 323 | cur_tok = strtok(NULL, " \t"); |
| 324 | if( !cur_tok ){ |
| 325 |
| --- src/export.c | |
| +++ src/export.c | |
| @@ -309,16 +309,11 @@ | |
| 309 | if( !cur_tok || strlen(cur_tok)<2 ){ |
| 310 | return -1; |
| 311 | } |
| 312 | mark->rid = atoi(&cur_tok[1]); |
| 313 | type_ = cur_tok[0]; |
| 314 | if( (type_!='c' && type_!='b') || mark->rid<=0 ){ |
| 315 | return -1; |
| 316 | } |
| 317 | |
| 318 | cur_tok = strtok(NULL, " \t"); |
| 319 | if( !cur_tok ){ |
| 320 |