aboutsummaryrefslogtreecommitdiff
path: root/src/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/date.c')
-rw-r--r--src/date.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/date.c b/src/date.c
index 0f0522604..f1230d6c5 100644
--- a/src/date.c
+++ b/src/date.c
@@ -16,7 +16,7 @@
** sqlite3RegisterDateTimeFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: date.c,v 1.64 2007/05/04 13:15:56 drh Exp $
+** $Id: date.c,v 1.65 2007/05/08 15:15:02 drh Exp $
**
** NOTES:
**
@@ -774,7 +774,8 @@ static void strftimeFunc(
sqlite3_value **argv
){
DateTime x;
- int n, i, j;
+ u64 n;
+ int i, j;
char *z;
const char *zFmt = (const char*)sqlite3_value_text(argv[0]);
char zBuf[100];
@@ -814,6 +815,9 @@ static void strftimeFunc(
}
if( n<sizeof(zBuf) ){
z = zBuf;
+ }else if( n>SQLITE_MAX_LENGTH ){
+ sqlite3_result_error_toobig(context);
+ return;
}else{
z = sqliteMalloc( n );
if( z==0 ) return;