Fix potential unsigned integer underflow in jsonAppendString().

FossilOrigin-Name: d2fba2cbdc3870d34228c1a9446eced884325acc183900d7dd0b96132570fb4a
This commit is contained in:
drh
2023-12-02 15:06:43 +00:00
parent 82136d90f8
commit 4cd397c0d9
3 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -603,7 +603,7 @@ static void jsonAppendString(JsonString *p, const char *zIn, u32 N){
p->zBuf[p->nUsed++] = '"';
while( 1 /*exit-by-break*/ ){
k = 0;
while( k<N-1 && jsonIsOk[z[k]] && jsonIsOk[z[k+1]] ){ k += 2; }
while( k+1<N && jsonIsOk[z[k]] && jsonIsOk[z[k+1]] ){ k += 2; }
while( k<N && jsonIsOk[z[k]] ){ k++; }
if( k>=N ){
if( k>0 ){