mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-21 11:13:54 +03:00
Avoid potential overflow in hex(). [forum:/forumpost/7ac0c9c5ea|See forum post 7ac0c9c5ea.]
FossilOrigin-Name: 2e968114fd0e60eebcc088dec02684e10b06ac1ec42d6bedb5287362f5cbf032
This commit is contained in:
@@ -1256,7 +1256,8 @@ static void hexFunc(
|
||||
*(z++) = hexdigits[c&0xf];
|
||||
}
|
||||
*z = 0;
|
||||
sqlite3_result_text(context, zHex, n*2, sqlite3_free);
|
||||
sqlite3_result_text64(context, zHex, (u64)(z-zHex),
|
||||
sqlite3_free, SQLITE_UTF8);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user