cln/db
Matt Whitlock 41d31dcd19 avoid UB when calling ctype functions
The character classification functions in <ctype.h> are designed to
classify characters returned by <stdio.h> getchar() and friends, which
return characters as signed integers in the range 0 to 255 or EOF. The
behavior of the ctype functions is undefined if they are passed a value
outside of that range, which may happen if they are passed a char-typed
value and the system's char type is signed.

<ccan/str/str.h> defines some inline utility functions that perform the
necessary cast to coerce a char-typed argument into the allowed value
range. Call these wrappers instead of the bare ctype functions when
classifying char-typed characters.

Changelog-None
2025-08-18 14:03:20 +09:30
..
bindings.c db: hand amount_msat / amount_sat by copy, not pointer. 2025-08-14 19:49:09 +09:30
bindings.h db: hand amount_msat / amount_sat by copy, not pointer. 2025-08-14 19:49:09 +09:30
common.h lightningd, pyln-testing: do extra checks to make sure check *cannot* write to db. 2023-10-26 12:59:55 +10:30
db_postgres.c db: remove #if DEVELOPER in favor of runtime flag inside db struct. 2023-09-21 20:08:24 +09:30
db_sqlite3.c avoid UB when calling ctype functions 2025-08-18 14:03:20 +09:30
exec.c lightningd, pyln-testing: do extra checks to make sure check *cannot* write to db. 2023-10-26 12:59:55 +10:30
exec.h lightningd, pyln-testing: do extra checks to make sure check *cannot* write to db. 2023-10-26 12:59:55 +10:30
Makefile database: pull out database code into a new module 2022-03-05 15:03:34 +10:30
utils.c db: better diagnostics when a query fails. 2025-08-14 19:49:09 +09:30
utils.h db: remove #if DEVELOPER in favor of runtime flag inside db struct. 2023-09-21 20:08:24 +09:30