0001-PostgreSQL-driver-Fix-incompatible-pointer-to-intege.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. These result in out-of-bounds stack writes on 64-bit architectures
  6. (caller has 4 bytes, callee writes 8 bytes), and seem to have gone
  7. unnoticed on little-endian architectures (although big-endian
  8. architectures must be broken).
  9. This change is required to avoid a build failure with GCC 14.
  10. Upstream: https://github.com/lurcher/unixODBC/commit/45f501e1be2db6b017cc242c79bfb9de32b332a1
  11. Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
  12. ---
  13. Drivers/Postgre7.1/info.c | 6 +++---
  14. 1 file changed, 3 insertions(+), 3 deletions(-)
  15. diff --git a/Drivers/Postgre7.1/info.c b/Drivers/Postgre7.1/info.c
  16. index 63ac91f..2216ecd 100644
  17. --- a/Drivers/Postgre7.1/info.c
  18. +++ b/Drivers/Postgre7.1/info.c
  19. @@ -1779,14 +1779,14 @@ char *table_name;
  20. char index_name[MAX_INFO_STRING];
  21. short fields_vector[8];
  22. char isunique[10], isclustered[10];
  23. -SDWORD index_name_len, fields_vector_len;
  24. +SQLLEN index_name_len, fields_vector_len;
  25. TupleNode *row;
  26. int i;
  27. HSTMT hcol_stmt;
  28. StatementClass *col_stmt, *indx_stmt;
  29. char column_name[MAX_INFO_STRING], relhasrules[MAX_INFO_STRING];
  30. char **column_names = 0;
  31. -Int4 column_name_len;
  32. +SQLLEN column_name_len;
  33. int total_columns = 0;
  34. char error = TRUE;
  35. ConnInfo *ci;
  36. @@ -2136,7 +2136,7 @@ HSTMT htbl_stmt;
  37. StatementClass *tbl_stmt;
  38. char tables_query[STD_STATEMENT_LEN];
  39. char attname[MAX_INFO_STRING];
  40. -SDWORD attname_len;
  41. +SQLLEN attname_len;
  42. char pktab[MAX_TABLE_LEN + 1];
  43. Int2 result_cols;