1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Use caution to avoid integer overflow when doing real to integer affinity

operations.  Ticket #3922. (CVS 6776)

FossilOrigin-Name: 392559465d499f491907ef7f42d37a1a6c699511
This commit is contained in:
drh
2009-06-17 16:20:04 +00:00
parent 042d6a1f0f
commit 94c3a2b16f
6 changed files with 87 additions and 15 deletions

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.259 2009/06/10 11:07:01 drh Exp $
** $Id: util.c,v 1.260 2009/06/17 16:20:04 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -392,7 +392,7 @@ int sqlite3AtoF(const char *z, double *pResult){
*/
static int compare2pow63(const char *zNum){
int c;
c = memcmp(zNum,"922337203685477580",18);
c = memcmp(zNum,"922337203685477580",18)*10;
if( c==0 ){
c = zNum[18] - '8';
}