From: drh <> Date: Tue, 19 May 2026 10:30:29 +0000 (+0000) Subject: Fix a NULL pointer dereference in the obscure (and unused) prefixes X-Git-Tag: release~46 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=4e2383b65b141cfaba1464a6778b97f9fbc5d0f2;p=thirdparty%2Fsqlite.git Fix a NULL pointer dereference in the obscure (and unused) prefixes extension, which I had forgotten even existed. FossilOrigin-Name: 24b8ecd17f70f222c40aa91382515a7d0d0b82c882498ae0714818d672806e7f --- diff --git a/ext/misc/prefixes.c b/ext/misc/prefixes.c index 3c47933c06..9637b92fbe 100644 --- a/ext/misc/prefixes.c +++ b/ext/misc/prefixes.c @@ -289,6 +289,10 @@ static void prefixLengthFunc( int nL = sqlite3_value_bytes(apVal[0]); int nR = sqlite3_value_bytes(apVal[1]); int i; + if( zL==0 || zR==0 ){ + sqlite3_result_int(ctx, 0); + return; + } nByte = (nL > nR ? nL : nR); for(i=0; i