From: drh <> Date: Mon, 18 Dec 2023 13:51:54 +0000 (+0000) Subject: Bug fix in the randomjson.c extension. X-Git-Tag: version-3.45.0~71 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=52a4691fff3333dc8b97253064b20c07e044d58c;p=thirdparty%2Fsqlite.git Bug fix in the randomjson.c extension. FossilOrigin-Name: 1f3a33df530dbe330ea8b14a69369b807b413b25a167d1a3938f8f0faf97cc91 --- diff --git a/ext/misc/randomjson.c b/ext/misc/randomjson.c index d64eb69327..20ee12b9fe 100644 --- a/ext/misc/randomjson.c +++ b/ext/misc/randomjson.c @@ -138,11 +138,7 @@ static void jsonExpand( char zBuf[200]; j = 0; - if( zSrc==0 ){ - k = prngInt(p)%(count(azJsonTemplate)/2); - k = k*2 + eType; - zSrc = azJsonTemplate[k]; - } + if( zSrc==0 ) zSrc = "%"; if( strlen(zSrc)>=STRSZ/10 ) r = 0; for(i=0; zSrc[i]; i++){ if( zSrc[i]!='%' ){ @@ -182,6 +178,8 @@ static void jsonExpand( zX = strstr(zX, "DD"); } } + assert( strstr(z, "XX")==0 ); + assert( strstr(z, "DD")==0 ); if( j+n