mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Never use strlen(). Use our own internal sqlite3Strlen30() which is
guaranteed to never overflow an integer. Additional explicit casts to avoid nuisance warning messages. (CVS 6007) FossilOrigin-Name: c872d554930ecf221ac2be5f886d5d67bb35288c
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
**
|
||||
** Memory allocation functions used throughout sqlite.
|
||||
**
|
||||
** $Id: malloc.c,v 1.49 2008/12/05 15:24:17 drh Exp $
|
||||
** $Id: malloc.c,v 1.50 2008/12/10 19:26:24 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <stdarg.h>
|
||||
@@ -724,7 +724,7 @@ char *sqlite3DbStrDup(sqlite3 *db, const char *z){
|
||||
if( z==0 ){
|
||||
return 0;
|
||||
}
|
||||
n = strlen(z)+1;
|
||||
n = (db ? sqlite3Strlen(db, z) : sqlite3Strlen30(z))+1;
|
||||
assert( (n&0x7fffffff)==n );
|
||||
zNew = sqlite3DbMallocRaw(db, (int)n);
|
||||
if( zNew ){
|
||||
|
||||
Reference in New Issue
Block a user