[php-src] PR #22026: sqlite3: fix internal return type violation in escapeString()
| From: | ndossche | Date: | Tue, 12 May 2026 18:54:29 +0000 |
| Subject: | [php-src] PR #22026: sqlite3: fix internal return type violation in escapeString() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36108@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22026
Author: ndossche
If this call fails due to an internal libsqlite3 error, then the function will return NULL (as
that's the default value set by the VM). However, the function is marked with a non-nullable
string return type. Therefore this will result in a type violation and a fatal error in debug mode.
Either we solve it by making the function nullable or throw. I chose the latter as it is less of a
footgun.
Found by a static-dynamic analyser I'm developing.