Commit Graph

44 Commits

Author SHA1 Message Date
dan
77eb3e305c Fix a buffer overrun that could occur when using the format() function to format a very small real value with the "," modifier.
FossilOrigin-Name: 910e770ad4d8e8e45bf069af963f2e975bfcfb882578dc5fe714cd2396258934
2023-05-05 19:36:13 +00:00
drh
4b04ced3e0 Fix an incorrect optimization that was attempted as part of
check-in [18de3a8e6b431a07].

FossilOrigin-Name: f32055e8110a2eac6c9e26d1d1e620f0668bcb475d49d309dc549cea05e1e582
2023-02-24 01:08:35 +00:00
drh
4df23a3248 Increased precision of floating-point to decimal conversions when the
floating point value has no fractional part.
[forum:/forumpost/d1387c3979c7f557|Forum post d1387c3979c7f557]

FossilOrigin-Name: 18de3a8e6b431a075143631eafdcf0e1b1a21868b417394c365d46d2feca10b5
2023-02-23 21:18:47 +00:00
dan
cfb8bf6a50 Modify a test file to avoid causing Tcl to allocate too much memory.
FossilOrigin-Name: 232431f32ef77a9dfc4eeb7765dca24af72051fd5460f648d0c5ba318c8a01fc
2020-06-09 13:53:56 +00:00
drh
dd6c33d372 Limit the "precision" of floating-point to text conversions in the printf()
function to 100,000,000.  Fix for ticket [23439ea582241138].

FossilOrigin-Name: d08d3405878d394e08e5d3af281246edfbd81ca74cc8d16458808591512fb93d
2020-05-23 19:58:07 +00:00
drh
255a81f10a Modify sqlite3_str_finish() and sqlite3VMPrintf() so that they always
return NULL on any OOM or SQLITE_LIMIT_LENGTH error.

FossilOrigin-Name: e7144ffd21294d7aebbfa6aa5a262797a6d16de11193f1bf6b75f5f27b04c940
2019-02-22 15:42:10 +00:00
dan
253c6ee1bf Enhance tester.tcl so that when "--malloctrace=1" is specified, the test
generates self-contained Tcl scripts that present GUIs instead of *.sql files
that require a separate program to interpret.

FossilOrigin-Name: de2e3cbd08c00d235106c040fa472ec267ef8f1ec13c34ed7d16deac8d50b6cc
2018-09-18 17:00:06 +00:00
drh
b6f47deb0c Avoid signed integer overflow when converting oversized in-line integer
widths and precisions in printf().

FossilOrigin-Name: 8e4ac2ce24415926247961b00a62425ae85d6ffb
2015-04-07 15:39:29 +00:00
dan
8c069147ce Another change to avoid a problem caused by integer overflow in the printf() code.
FossilOrigin-Name: 95625ef3adc3c408d67e70f877f390445fbb8292
2015-04-07 14:38:57 +00:00
drh
a30d22a7a6 Further changes to guard against integer overflow in the width and precision
of printf() arguments.

FossilOrigin-Name: 5ce4e7d7651e5c72a59f03f7aeb366291e62ab57
2015-04-07 13:28:41 +00:00
drh
74b42275ec Guard against excessive width and precision in floating-point conversions
in the printf routines.

FossilOrigin-Name: c494171f77dc2e5e04cb6d865e688448f04e5920
2015-04-07 12:41:17 +00:00
drh
59eedf7925 Remove all precision and width limits from formatting fields in the
sqlite3_mprintf() family of functions. Malloc for space as necessary.
The prevents a stack overflow on very large numbers using %f.

FossilOrigin-Name: 1f843fb383583ee7ef51c13b8a820744e450101a
2011-10-11 17:54:54 +00:00
drh
8965b50edf Enhance the %q, %Q, and %w printf conversions so that the precisions
specifies the length of the input.

FossilOrigin-Name: 3ba773132d3baeb87acaee538b8fb0b0f4293673
2009-11-25 16:53:37 +00:00
drh
c5cad1e350 Add a new test command, sqlite3_mprintf_long, for testing the behavior
of "long integer" printf formatting.  Ticket #3621. (CVS 6224)

FossilOrigin-Name: 3ba1a17b1306bc61b9861ec8d3b239e16a3081ba
2009-02-01 00:21:09 +00:00
drh
af005fbc13 Test coverage improvements on printf. (CVS 5385)
FossilOrigin-Name: 2d8f7bebf0f13f3a95f1e2163e35d43229cabfea
2008-07-09 16:51:51 +00:00
drh
f43639a0bc Test coverage improvements in printf.c. (CVS 5360)
FossilOrigin-Name: 6f2629c78327bb6cbb15d1f9900a1ef58f2d37dd
2008-07-08 02:24:02 +00:00
drh
a2647cae50 Modify the printf test script so that it does not depend on the platform
printf, so that we do not spurious test failures when moving from one
platform to another. (CVS 4767)

FossilOrigin-Name: 514d7e474391278a121af285dc4aca6216358ad7
2008-02-01 01:19:53 +00:00
danielk1977
369ff42e77 Fixes to test code so that the test suite passes without SQLITE_MEMDEBUG defined. (CVS 4370)
FossilOrigin-Name: ed2a2e0102c4fd2221096028d55a6f1d54f97274
2007-09-03 07:31:09 +00:00
danielk1977
b8cdbec246 Allow sqlite3GetInt32 to recognize 10-digit decimal numbers as 32-bit. (CVS 4362)
FossilOrigin-Name: 7571345d2078fb52029f9b9924d833ec36d443e6
2007-09-01 10:01:12 +00:00
danielk1977
ca0c89715e Fix a problem handling a malloc() failure in printf.c. Also some other things to improve test coverage. (CVS 4361)
FossilOrigin-Name: 595bfe72f053bc6ecb58bb9044a4cdc53d30b404
2007-09-01 09:02:53 +00:00
drh
53c1402157 Add some UTF-8 test infrastructure. Treat NaN as NULL. The printf routines
print infinity as "Inf" not as "NaN".  Ticket #2345. (CVS 3972)

FossilOrigin-Name: ffe615a71107a38b6f60c7baf4284a5b0aecdc22
2007-05-10 17:23:11 +00:00
drh
6885390791 Change sqlite3_snprintf() so that it does not write a zero-terminator if
the buffer size argument is less than 1.  Ticket #2341.  Added documentation
about the sqlite3_snprintf() function. (CVS 3935)

FossilOrigin-Name: f3ae4ac5fe0bfa2f91e76a6def86c444e51fe80b
2007-05-07 11:24:30 +00:00
drh
b3738b6c85 Improved test coverage for printf.c. (CVS 3780)
FossilOrigin-Name: c2badb208ff1207a1471410965947893b070ea50
2007-03-31 15:02:49 +00:00
drh
05a8298338 Increase test coverage to above 98%. (CVS 3144)
FossilOrigin-Name: 8ae6ccc715b081cd422e847cd9e5cc22b04d8512
2006-03-19 13:00:25 +00:00
drh
43617e9ab9 Code changes resulting from Coverity analysis.
http://scan.coverity.com/  Found 1 potential segfault in sqlite3_mprintf().
Also 2 failures to fclose() following a malloc() failure.  And lots of
cases where unnecessary conditionals could be removed from the code. (CVS 3126)

FossilOrigin-Name: e510e6dd9d6261f33b853af3b32d155b9d6b63b3
2006-03-06 20:55:46 +00:00
drh
79158e1865 Changes to reduce the amount of stack space required. (CVS 2661)
FossilOrigin-Name: b86bd70f301205d6ca66475a425e157b976107e2
2005-09-06 21:40:45 +00:00
drh
63782855ee Fix printf.c so that it handles 10.0 correctly. (CVS 2643)
FossilOrigin-Name: 0f7a53f78d9dd5c426be834f2d50a6fe4e860141
2005-08-30 19:30:59 +00:00
drh
5eba8c09df Increased test coverage on trigger.c and printf.c. (CVS 2601)
FossilOrigin-Name: 842a80bd8f18d6fd046604f9a057bcd738234f1f
2005-08-19 02:26:27 +00:00
drh
557cc60f4d Add the "!" flag to the "%g" mprintf conversion parameter to force a
decimal point.  This prevents floating point values from appearing as
integers.  Use this flag when converting floating point to text.
Ticket #1362. (CVS 2586)

FossilOrigin-Name: 4b98dace6b90abf4a6fe1cd51e6392fd213358c4
2005-08-13 12:59:14 +00:00
drh
592ac8cb6c Make the round() function work correctly on numbers with very large exponents.
Ticket #1340. (CVS 2585)

FossilOrigin-Name: 4f47c3c884e38b810450b6127ab33c7b86e6743c
2005-08-13 03:07:47 +00:00
drh
6aff507e73 Trying to get some tests in printf.test to pass on 64-bit systems. (CVS 1952)
FossilOrigin-Name: b12fc46dcd5aa901fc781a17d49f8f110fed5b8d
2004-09-09 00:35:29 +00:00
drh
9796ef5804 Additional test case to cover ticket #831. (CVS 1872)
FossilOrigin-Name: a62129af99b4a576a48eb4931f417af257f510c7
2004-07-27 13:38:47 +00:00
drh
e29b1a05a7 mprintf() correctly handles "%s","". Fix for ticket #812. (CVS 1800)
FossilOrigin-Name: 4f56db1149f65dc2edf6626fa20ae255a5f5280c
2004-07-17 21:56:09 +00:00
drh
779c6a0647 Improved test coverage of table.c and printf.c. (CVS 1762)
FossilOrigin-Name: ba87834d863cb50f3016ccb04f790be5fa4070c6
2004-06-29 13:04:32 +00:00
drh
e970767144 Fix signed integer problems in vxprintf. Ticket #778. Also remove some
dead code from util.c. (CVS 1685)

FossilOrigin-Name: 200cd3baf60e6cfad9fa3971834367821456ae30
2004-06-25 01:10:48 +00:00
danielk1977
2dd59365ed Update some old tests to use the new API. (CVS 1593)
FossilOrigin-Name: af6edd2c0ad160435acd5bfa7af36c4f394f0bb8
2004-06-14 23:46:47 +00:00
drh
b621c23775 Test cases for printf of double overflows. (CVS 1260)
FossilOrigin-Name: 96a6d2d3ff5bd0aaff188ee1c5e2f02cbea435b2
2004-02-21 19:41:04 +00:00
drh
e84a306b91 Remove undocumented extensions from sqlite_mprintf() and friends in order to
make it about 10% smaller. (CVS 1207)

FossilOrigin-Name: 0b3f552b986fd89c48c350b0746be93b9d276ecc
2004-02-02 12:29:25 +00:00
drh
d93d8a812e Add the %z format to the sqlite_mprintf() and related functions. (CVS 1028)
FossilOrigin-Name: eca1398eaac67d772aff2676a470d9a6d96a93ca
2003-06-16 03:08:18 +00:00
chw
b22f1b58ac Added printf-4.(2-4) test cases to test new %Q format specifier. (CVS 622)
FossilOrigin-Name: 7d5fc35b5d38230230344b4f70763f75940ab908
2002-06-16 04:56:36 +00:00
drh
254cba2429 2.0-Alpha-2 release (CVS 258)
FossilOrigin-Name: d2a1aac46782c0d3852e34a3b32a6b2ccd93a256
2001-09-20 01:44:42 +00:00
drh
b19a2bc603 Disclaimed copyright. Preparing for release 2.0. (CVS 250)
FossilOrigin-Name: 4e926efe2b59adfec4086eb1d2ba830238facb4c
2001-09-16 00:13:26 +00:00
drh
daffd0e597 better handling of out-of-memory errors (CVS 207)
FossilOrigin-Name: 86b30cd0975dfea9424b9f9f0d4194aa71ce508b
2001-04-11 14:28:42 +00:00
drh
d1bf3512fa Added new tests (CVS 206)
FossilOrigin-Name: 2507ec40610d8034ccf9dcb58a16934065e6f120
2001-04-07 15:24:33 +00:00