1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-10-23 21:49:02 +03:00

Add assert() statements and comments to explain why the return value of sqlite3_column_name() does not need to be checked in fts3.c. Repor [bugs:/info/2026-08-25T17:08:22Z | 2026-08-25T17:08:22Z].

FossilOrigin-Name: 08b34b1656b7dec2328345bb8ea93d75193703aaff52546fc17844b7110b2741
This commit is contained in:
dan
2026-08-25 18:28:21 +00:00
parent 112122c2f9
commit 39ccdd9314
3 changed files with 12 additions and 8 deletions

View File

@@ -1130,7 +1130,10 @@ static int fts3ContentColumns(
** nul-terminator byte. */
nCol = sqlite3_column_count(pStmt);
for(i=0; i<nCol; i++){
/* This call to sqlite3_column_name() cannot fail, as no conversion
** between encodings, and therefore no malloc() call, is required. */
const char *zCol = sqlite3_column_name(pStmt, i);
assert( zCol );
nStr += strlen(zCol) + 1;
}
@@ -1143,6 +1146,7 @@ static int fts3ContentColumns(
for(i=0; i<nCol; i++){
const char *zCol = sqlite3_column_name(pStmt, i);
int n = (int)strlen(zCol)+1;
assert( zCol ); /* no malloc() required, cannot fail */
memcpy(p, zCol, n);
azCol[i] = p;
p += n;

View File

@@ -1,5 +1,5 @@
C Avoid\sa\spossible\sNULL\spointer\sdereference\sin\sthe\sQRF\ssublibrary\swhen\ncompiled\swith\sSQLITE_ENABLE_STMT_SCANSTATUS.
D 2026-08-25T18:26:40.670
C Add\sassert()\sstatements\sand\scomments\sto\sexplain\swhy\sthe\sreturn\svalue\sof\ssqlite3_column_name()\sdoes\snot\sneed\sto\sbe\schecked\sin\sfts3.c.\sRepor\s[bugs:/info/2026-08-25T17:08:22Z\s|\s2026-08-25T17:08:22Z].
D 2026-08-25T18:28:21.581
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -80,7 +80,7 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c
F ext/fts3/README.syntax b72477722e9b4fe43f8403227d790a1c94221bfad15c27863a4b36d1052e892b
F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
F ext/fts3/fts3.c 3a68333835a5152e16bc7059b50c049b2ccb616bea165b319b456ba796b0a5e7
F ext/fts3/fts3.c 2e56a160b5da3c274b06a7a59b0757ad6f29ddf5cff0ab9a440dcd935cfe9569
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
F ext/fts3/fts3Int.h 277f32f304e82f4397fc2a74793c0a95318b7abb9670b519e4805a00946cbd9b
F ext/fts3/fts3_aux.c c5d0a3726cf938070317f2e7620b69cd9dd81dc0e1d920d8ff52128a396ba3d6
@@ -2219,8 +2219,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
P 555489e4c21f5ab65364c73217ec76202a5c97d2f4d66cf38e00158af13ecad6
R 6a1de0f97d0fead642c2b876df04e782
U drh
Z 0a754b968ff17e18d14ddb97f53e7fd5
P 58014b2a2efdf0800946591d2d53d1c001a9b58681156dc201aa542912567570
R bae511cf29c055b8998e679913e9c01a
U dan
Z f06abd8e36efb000a4f308827acb7273
# Remove this line to create a well-formed Fossil manifest.

View File

@@ -1 +1 @@
58014b2a2efdf0800946591d2d53d1c001a9b58681156dc201aa542912567570
08b34b1656b7dec2328345bb8ea93d75193703aaff52546fc17844b7110b2741