Fossil SCM

In send_unversioned_file(), finalize the statement before returning when a SHA3 hash cannot be sent to a client older than version 2.0. Leaving the statement, a local variable, on the list of open statements made the next finalize read and write a stack frame that had already returned.

dmestas 2026-11-13 23:40 UTC small-fixes-2
Commit 34e92f7340e01b81dd698b627df65596ce7c65cc5ec0dec45257bc1795a4f156
1 file changed +1 -1
+1 -1
--- src/xfer.c
+++ src/xfer.c
@@ -749,11 +749,11 @@
749749
if( db_step(&q1)==SQLITE_ROW ){
750750
sqlite3_int64 mtime = db_column_int64(&q1, 0);
751751
const char *zHash = db_column_text(&q1, 1);
752752
if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){
753753
xfer_cannot_send_sha3_error(pXfer);
754
- db_reset(&q1);
754
+ db_finalize(&q1);
755755
return;
756756
}
757757
if( isFull ){
758758
/* If we have already reached the send size limit, send a (short)
759759
** uvigot card rather than a uvfile card. This only happens on the
760760
--- src/xfer.c
+++ src/xfer.c
@@ -749,11 +749,11 @@
749 if( db_step(&q1)==SQLITE_ROW ){
750 sqlite3_int64 mtime = db_column_int64(&q1, 0);
751 const char *zHash = db_column_text(&q1, 1);
752 if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){
753 xfer_cannot_send_sha3_error(pXfer);
754 db_reset(&q1);
755 return;
756 }
757 if( isFull ){
758 /* If we have already reached the send size limit, send a (short)
759 ** uvigot card rather than a uvfile card. This only happens on the
760
--- src/xfer.c
+++ src/xfer.c
@@ -749,11 +749,11 @@
749 if( db_step(&q1)==SQLITE_ROW ){
750 sqlite3_int64 mtime = db_column_int64(&q1, 0);
751 const char *zHash = db_column_text(&q1, 1);
752 if( pXfer->remoteVersion<20000 && db_column_bytes(&q1,1)>HNAME_LEN_SHA1 ){
753 xfer_cannot_send_sha3_error(pXfer);
754 db_finalize(&q1);
755 return;
756 }
757 if( isFull ){
758 /* If we have already reached the send size limit, send a (short)
759 ** uvigot card rather than a uvfile card. This only happens on the
760

Keyboard Shortcuts

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