|
| 1 | +From 45f501e1be2db6b017cc242c79bfb9de32b332a1 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Florian Weimer <fweimer@redhat.com> |
| 3 | +Date: Mon, 29 Jan 2024 08:27:29 +0100 |
| 4 | +Subject: [PATCH] PostgreSQL driver: Fix incompatible pointer-to-integer types |
| 5 | + |
| 6 | +These result in out-of-bounds stack writes on 64-bit architectures |
| 7 | +(caller has 4 bytes, callee writes 8 bytes), and seem to have gone |
| 8 | +unnoticed on little-endian architectures (although big-endian |
| 9 | +architectures must be broken). |
| 10 | + |
| 11 | +This change is required to avoid a build failure with GCC 14. |
| 12 | +--- |
| 13 | + Drivers/Postgre7.1/info.c | 6 +++--- |
| 14 | + 1 file changed, 3 insertions(+), 3 deletions(-) |
| 15 | + |
| 16 | +diff --git a/Drivers/Postgre7.1/info.c b/Drivers/Postgre7.1/info.c |
| 17 | +index 63ac91f..2216ecd 100644 |
| 18 | +--- a/Drivers/Postgre7.1/info.c |
| 19 | ++++ b/Drivers/Postgre7.1/info.c |
| 20 | +@@ -1779,14 +1779,14 @@ char *table_name; |
| 21 | + char index_name[MAX_INFO_STRING]; |
| 22 | + short fields_vector[8]; |
| 23 | + char isunique[10], isclustered[10]; |
| 24 | +-SDWORD index_name_len, fields_vector_len; |
| 25 | ++SQLLEN index_name_len, fields_vector_len; |
| 26 | + TupleNode *row; |
| 27 | + int i; |
| 28 | + HSTMT hcol_stmt; |
| 29 | + StatementClass *col_stmt, *indx_stmt; |
| 30 | + char column_name[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING]; |
| 31 | + char **column_names = 0; |
| 32 | +-Int4 column_name_len; |
| 33 | ++SQLLEN column_name_len; |
| 34 | + int total_columns = 0; |
| 35 | + char error = TRUE; |
| 36 | + ConnInfo *ci; |
| 37 | +@@ -2136,7 +2136,7 @@ HSTMT htbl_stmt; |
| 38 | + StatementClass *tbl_stmt; |
| 39 | + char tables_query[STD_STATEMENT_LEN]; |
| 40 | + char attname[MAX_INFO_STRING]; |
| 41 | +-SDWORD attname_len; |
| 42 | ++SQLLEN attname_len; |
| 43 | + char pktab[MAX_TABLE_LEN + 1]; |
| 44 | + Int2 result_cols; |
0 commit comments