From: drh <> Date: Mon, 18 May 2026 23:58:14 +0000 (+0000) Subject: Fix a NULL pointer dereference in the obscure (and unused) prefixes X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=d0fd0cc2faa00d3f251e35fa5e46677a8c398d1c;p=thirdparty%2Fsqlite.git Fix a NULL pointer dereference in the obscure (and unused) prefixes extension, which I had forgotten even existed. [bugs:/forumpost/24a33e5d10|Bug report 24a33e5d10]. FossilOrigin-Name: 4880adc053b0f21633936347fd5610e4338b15da39607d8ba5a6b32d1516e8cb --- 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