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.

dmestas 2026-11-21 12:09 UTC small-fixes
Commit ad6172d525212be5d11033f3ec95ef103c3bc8e19e15afe09231125fe2a30d45
1 file changed +1 -6
+1 -6
--- src/export.c
+++ src/export.c
@@ -309,16 +309,11 @@
309309
if( !cur_tok || strlen(cur_tok)<2 ){
310310
return -1;
311311
}
312312
mark->rid = atoi(&cur_tok[1]);
313313
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 ){
320315
return -1;
321316
}
322317
323318
cur_tok = strtok(NULL, " \t");
324319
if( !cur_tok ){
325320
--- 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

Keyboard Shortcuts

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