]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove instances of strcpy() from test code. Use memcpy() or
authordrh <drh@noemail.net>
Tue, 19 Feb 2008 18:29:07 +0000 (18:29 +0000)
committerdrh <drh@noemail.net>
Tue, 19 Feb 2008 18:29:07 +0000 (18:29 +0000)
sqlite3_snprintf() instead. (CVS 4801)

FossilOrigin-Name: 7b50140dc0fb41a1b40c8709d96e214d98b06f81

manifest
manifest.uuid
src/func.c
src/test1.c

index 8ee30527c16b8dcb21a5c1e44ef263585c259380..10e659c7fb8acceba9a8b9a6e3bccab23d6af2de 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Remove\san\sinstance\sof\ssprintf()\sfrom\sthe\sVM\simplementation.\s\sSQLite\sshould\nnot\suse\ssprintf()\sfrom\sthe\sC\slibrary\s-\sit\shas\sits\sown\simplementation.\s(CVS\s4800)
-D 2008-02-19T18:28:14
+C Remove\sinstances\sof\sstrcpy()\sfrom\stest\scode.\sUse\smemcpy()\sor\nsqlite3_snprintf()\sinstead.\s(CVS\s4801)
+D 2008-02-19T18:29:07
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in bc2b5df3e3d0d4b801b824b7ef6dec43812b049b
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -95,7 +95,7 @@ F src/delete.c fa13c296262e89c32d28949f15be275e52d7f524
 F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
 F src/expr.c e6fb42c6e55fd9526174b1cb8296b69a60a6688a
 F src/fault.c 049b88b8ba0a1db3240aeaf9695cd08b9a3ba9e1
-F src/func.c 8e3d0c59961dc403716767308ee764504179054b
+F src/func.c 194cd8a9549be77d7b2a93eeaeb8ede893277293
 F src/hash.c 53655c312280211444bfe23af6490a460aec2980
 F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
 F src/insert.c b313f5ecadf82dda15b1aa6780b0310eceb9e776
@@ -143,7 +143,7 @@ F src/sqliteInt.h 073801285d2650b22033a20c2389241c5e0361d6
 F src/sqliteLimit.h ee4430f88f69bf63527967bb35ca52af7b0ccb1e
 F src/table.c 46ccf9b7892a86f57420ae7bac69ecd5e72d26b5
 F src/tclsqlite.c d95e0e74c7167b2807f9f4f73bf45f7c58096297
-F src/test1.c 785e737ff4dac36c384633501402a4437eb027a6
+F src/test1.c c7763d9bf747c94d04254bd6cc18ecbb2c565ad2
 F src/test2.c 355d5693ca3ee705548fa7f795592a37b2372b70
 F src/test3.c 4557ee13c6e5921eb28979ff77cdbd913bfde6be
 F src/test4.c c2c0f5dc907f1346f5d4b65eb5799f11eb9e4071
@@ -621,7 +621,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 9db346dede59e7185afcd7f21b2f578c9a4f949e
-R b23de96abb4d44d9a8e1d8fb87ef9128
+P 68f5ddddf0d1b5c8ed97dda0a32362a55637b5f2
+R 95dcd7a2db6ff273a951495091bfa925
 U drh
-Z e446824e18bb60941b9ff0ea385ca6ef
+Z 94dde115ea93b6ad849adc1b17145e45
index 8b074eb1b9e1964c5c517a95e2a35b76057823bf..20e9046848244d1c16db7cd1c2b8838350e39b5e 100644 (file)
@@ -1 +1 @@
-68f5ddddf0d1b5c8ed97dda0a32362a55637b5f2
\ No newline at end of file
+7b50140dc0fb41a1b40c8709d96e214d98b06f81
\ No newline at end of file
index 840254b7ea568f36ccb9fb2bc618c2d050c01188..9a4591ad2e113da95617647c32166abf719fa61b 100644 (file)
@@ -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] = ' ';
index 4cc3198547068274a30a118ce197774c1f553a77..7e878b9226f0dcad607436744ef976dea6d8b75c 100644 (file)
@@ -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;