aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/func.c9
-rw-r--r--src/test1.c4
2 files changed, 7 insertions, 6 deletions
diff --git a/src/func.c b/src/func.c
index 840254b7e..9a4591ad2 100644
--- a/src/func.c
+++ b/src/func.c
@@ -16,7 +16,7 @@
** sqliteRegisterBuildinFunctions() found at the bottom of the file.
** All other code has file scope.
**
-** $Id: func.c,v 1.183 2008/01/21 16:22:46 drh Exp $
+** $Id: func.c,v 1.184 2008/02/19 18:29:07 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -1146,6 +1146,7 @@ static void test_auxdata(
for(i=0; i<nArg; i++){
char const *z = (char*)sqlite3_value_text(argv[i]);
if( z ){
+ int n;
char *zAux = sqlite3_get_auxdata(pCtx, i);
if( zAux ){
zRet[i*2] = '1';
@@ -1153,10 +1154,10 @@ static void test_auxdata(
}else {
zRet[i*2] = '0';
}
-
- zAux = contextMalloc(pCtx, strlen(z)+1);
+ n = strlen(z) + 1;
+ zAux = contextMalloc(pCtx, n);
if( zAux ){
- strcpy(zAux, z);
+ memcpy(zAux, z, n);
sqlite3_set_auxdata(pCtx, i, zAux, free_test_auxdata);
}
zRet[i*2+1] = ' ';
diff --git a/src/test1.c b/src/test1.c
index 4cc319854..7e878b922 100644
--- a/src/test1.c
+++ b/src/test1.c
@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated
** testing of the SQLite library.
**
-** $Id: test1.c,v 1.289 2008/02/18 22:24:58 drh Exp $
+** $Id: test1.c,v 1.290 2008/02/19 18:29:07 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
@@ -487,7 +487,7 @@ static int test_snprintf_int(
const char *zFormat = argv[2];
int a1 = atoi(argv[3]);
if( n>sizeof(zStr) ) n = sizeof(zStr);
- strcpy(zStr, "abcdefghijklmnopqrstuvwxyz");
+ sqlite3_snprintf(sizeof(zStr), zStr, "abcdefghijklmnopqrstuvwxyz");
sqlite3_snprintf(n, zStr, zFormat, a1);
Tcl_AppendResult(interp, zStr, 0);
return TCL_OK;