]> git.joonet.de Git - adminer.git/commitdiff
Fix uninitialized string offset
authorAdrian Jones <adrianbjones@gmail.com>
Tue, 9 Apr 2024 02:01:37 +0000 (19:01 -0700)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:36 +0000 (11:16 +0100)
This can happen if you include an unpaired single or double quote, eg: SELECT * FROM table_name WHERE field_name = 'test

adminer/sql.inc.php

index 7a21235de988c3c057eefafb9b9a1380d7302296..216e36e2893b9a041b7580edabb4929b64f3288b 100644 (file)
@@ -87,7 +87,7 @@ if (!$error && $_POST) {
                                                                $query .= fread($fp, 1e5);
                                                        } else {
                                                                $offset = $match[0][1] + strlen($s);
-                                                               if ($s[0] != "\\") {
+                                                               if (!$s || $s[0] != "\\") {
                                                                        break;
                                                                }
                                                        }