From: drh Date: Fri, 12 Aug 2005 23:20:53 +0000 (+0000) Subject: 3rd argument to sqlite3Error() should always be a format string, never X-Git-Tag: version-3.6.10~3576 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2501eb1df60c6b3faa7dbcc1c83a1f6a83286b9c;p=thirdparty%2Fsqlite.git 3rd argument to sqlite3Error() should always be a format string, never user-supplied error message text. Ticket #1354. (CVS 2583) FossilOrigin-Name: d6146a542aacd10d349d432fe343cc17cc3b3ab5 --- diff --git a/manifest b/manifest index 7e007913f4..5d13fedaa4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\serror\smessage\swhen\sa\s#NNN\sparameter\sappears\son\suser\sinput.\nAdditional\scoverage\stesting.\s(CVS\s2582) -D 2005-08-12T22:58:53 +C 3rd\sargument\sto\ssqlite3Error()\sshould\salways\sbe\sa\sformat\sstring,\snever\nuser-supplied\serror\smessage\stext.\s\sTicket\s#1354.\s(CVS\s2583) +D 2005-08-12T23:20:53 F Makefile.in 22ea9c0fe748f591712d8fe3c6d972c6c173a165 F Makefile.linux-gcc 06be33b2a9ad4f005a5f42b22c4a19dab3cbb5c7 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -82,7 +82,7 @@ F src/vacuum.c 829d9e1a6d7c094b80e0899686670932eafd768c F src/vdbe.c 69f33e22c7d0a64b23fbb69e6da95a1bb6869032 F src/vdbe.h 68e80f65658e7fd85561721f617bdebf8bb84b59 F src/vdbeInt.h 9be9a6c43d38124bd03cc5cf05715605b1789fd9 -F src/vdbeapi.c 7f392f0792d1258c958083d7de9eae7c3530c9a6 +F src/vdbeapi.c dc5b78cabf8d6e33318bd3d4ed25307d2aadce9a F src/vdbeaux.c d53139d819b887dac608ac4ae9a501baee3cd311 F src/vdbefifo.c b8805850afe13b43f1de78d58088cb5d66f88e1e F src/vdbemem.c da8e8d6f29dd1323f782f000d7cd120027c9ff03 @@ -140,7 +140,7 @@ F test/enc2.test d1ab077b84f4d3099246915422b1ab6b81481e0a F test/enc3.test f6a5f0b7b7f3a88f030d3143729b87cd5c86d837 F test/expr.test 648f733f9d9aa9db82de59e69d1322b8b52f701a F test/fkey1.test 81bb13caaa78f58d7d191d7f535529f7c91d821a -F test/func.test b062105b45cf8fb5b386ba137180c0f439eea0c9 +F test/func.test 8f9165f0454b03f35c1f35668d516a96cbf4a41b F test/hook.test f8605cde4c77b2c6a4a73723bf6c507796a64dda F test/in.test cead6165aebbe0d451bb2263a307173acfeb6240 F test/index.test 51e01a0928b4b61228917ddd8c6c0e2466547f6f @@ -291,7 +291,7 @@ F www/tclsqlite.tcl 3df553505b6efcad08f91e9b975deb2e6c9bb955 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 528299b8316726dbcc5548e9aa0648c8b1bd055b -P 3edbe8d6217fd1180883e6b9f1e5b9011a39f80d -R ae2c3b65474b0ccf695425e1d93f57a6 +P 3c00f5982ae61dfcd26c33ccdb81736628dbfce5 +R bb6a49b284bb96bd609cd13df3546a3b U drh -Z 566241899895f3971c3c12f45ff1e8b0 +Z b1e3a307c55721ac0b733dec02c26dd9 diff --git a/manifest.uuid b/manifest.uuid index e0f4e6c289..21416d8d34 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3c00f5982ae61dfcd26c33ccdb81736628dbfce5 \ No newline at end of file +d6146a542aacd10d349d432fe343cc17cc3b3ab5 \ No newline at end of file diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 3366d20303..1097bb45b9 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -213,7 +213,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){ rc = SQLITE_MISUSE; } - sqlite3Error(p->db, rc, p->zErrMsg); + sqlite3Error(p->db, rc, "%s", p->zErrMsg); return rc; } diff --git a/test/func.test b/test/func.test index d8e5c3f09d..6d1fea1921 100644 --- a/test/func.test +++ b/test/func.test @@ -11,7 +11,7 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing built-in functions. # -# $Id: func.test,v 1.36 2005/06/25 18:42:16 drh Exp $ +# $Id: func.test,v 1.37 2005/08/12 23:20:53 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -485,6 +485,16 @@ do_test func-16.1 { } } {X'616263' NULL} +# Correctly handle function error messages that include %. Ticket #1354 +# +do_test func-17.1 { + proc testfunc1 args {error "Error %d with %s percents %p"} + db function testfunc1 ::testfunc1 + catchsql { + SELECT testfunc1(1,2,3); + } +} {1 {Error %d with %s percents %p}} + finish_test