Fossil SCM

When a sync-received file card does not hash to what it claims to, skip storing of the content to avoid that the otherwise-queued blob inevitably triggers fossil_fatal() via the verify-before-commit checks. Reported by Dan Mestas.

stephan 2026-10-12 07:53 UTC trunk
Commit 99546127422fb2d6c89b7d574f2d064fcc5468392cf2dcd78091e18cf097bb9c
1 file changed +2
+2
--- src/xfer.c
+++ src/xfer.c
@@ -208,10 +208,12 @@
208208
}else{
209209
pXfer->nFileRcvd++;
210210
}
211211
if( hname_verify_hash(&content, blob_buffer(pUuid), blob_size(pUuid))==0 ){
212212
blob_appendf(&pXfer->err, "wrong hash on received artifact: %b", pUuid);
213
+ blob_reset(&content);
214
+ return;
213215
}
214216
rid = content_put_ex(&content, blob_str(pUuid), 0, 0, isPriv);
215217
Th_AppendToList(pzUuidList, pnUuidList, blob_str(pUuid), blob_size(pUuid));
216218
if( rid==0 ){
217219
blob_appendf(&pXfer->err, "%s", g.zErrMsg);
218220
--- src/xfer.c
+++ src/xfer.c
@@ -208,10 +208,12 @@
208 }else{
209 pXfer->nFileRcvd++;
210 }
211 if( hname_verify_hash(&content, blob_buffer(pUuid), blob_size(pUuid))==0 ){
212 blob_appendf(&pXfer->err, "wrong hash on received artifact: %b", pUuid);
 
 
213 }
214 rid = content_put_ex(&content, blob_str(pUuid), 0, 0, isPriv);
215 Th_AppendToList(pzUuidList, pnUuidList, blob_str(pUuid), blob_size(pUuid));
216 if( rid==0 ){
217 blob_appendf(&pXfer->err, "%s", g.zErrMsg);
218
--- src/xfer.c
+++ src/xfer.c
@@ -208,10 +208,12 @@
208 }else{
209 pXfer->nFileRcvd++;
210 }
211 if( hname_verify_hash(&content, blob_buffer(pUuid), blob_size(pUuid))==0 ){
212 blob_appendf(&pXfer->err, "wrong hash on received artifact: %b", pUuid);
213 blob_reset(&content);
214 return;
215 }
216 rid = content_put_ex(&content, blob_str(pUuid), 0, 0, isPriv);
217 Th_AppendToList(pzUuidList, pnUuidList, blob_str(pUuid), blob_size(pUuid));
218 if( rid==0 ){
219 blob_appendf(&pXfer->err, "%s", g.zErrMsg);
220

Keyboard Shortcuts

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