b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 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 | --- a/Drivers/Postgre7.1/info.c |
| 17 | +++ b/Drivers/Postgre7.1/info.c |
| 18 | @@ -1779,14 +1779,14 @@ char *table_name; |
| 19 | char index_name[MAX_INFO_STRING]; |
| 20 | short fields_vector[8]; |
| 21 | char isunique[10], isclustered[10]; |
| 22 | -SDWORD index_name_len, fields_vector_len; |
| 23 | +SQLLEN index_name_len, fields_vector_len; |
| 24 | TupleNode *row; |
| 25 | int i; |
| 26 | HSTMT hcol_stmt; |
| 27 | StatementClass *col_stmt, *indx_stmt; |
| 28 | char column_name[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING]; |
| 29 | char **column_names = 0; |
| 30 | -Int4 column_name_len; |
| 31 | +SQLLEN column_name_len; |
| 32 | int total_columns = 0; |
| 33 | char error = TRUE; |
| 34 | ConnInfo *ci; |
| 35 | @@ -2136,7 +2136,7 @@ HSTMT htbl_stmt; |
| 36 | StatementClass *tbl_stmt; |
| 37 | char tables_query[STD_STATEMENT_LEN]; |
| 38 | char attname[MAX_INFO_STRING]; |
| 39 | -SDWORD attname_len; |
| 40 | +SQLLEN attname_len; |
| 41 | char pktab[MAX_TABLE_LEN + 1]; |
| 42 | Int2 result_cols; |
| 43 | |