File: 1011_psql-avoid-access-array-offset-on-val-of-type-bool.patch

package info (click to toggle)
php-horde-db 2.4.1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,432 kB
  • sloc: php: 9,202; xml: 1,007; sql: 22; sh: 16; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 722 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Avoid access to array offset on value of type bool.
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>

--- a/Horde_Db-2.4.1/lib/Horde/Db/Adapter/Postgresql/Schema.php
+++ b/Horde_Db-2.4.1/lib/Horde/Db/Adapter/Postgresql/Schema.php
@@ -1143,7 +1143,15 @@
         }
 
         // [primary_key, sequence]
-        return array($result['attname'], $result['relname']);
+        $_res_attname = null;
+        $_res_relname = null;
+        if (isset($result['attname'])) {
+            $_res_attname = $result['attname'];
+        }
+        if (isset($result['relname'])) {
+            $_res_relname = $result['relname'];
+        }
+        return array($_res_attname, $_res_relname);
     }
 
     /**