Fix type in test_escape test
authorAndres Freund <[email protected]>
Mon, 10 Feb 2025 17:09:23 +0000 (12:09 -0500)
committerAndres Freund <[email protected]>
Mon, 10 Feb 2025 17:13:02 +0000 (12:13 -0500)
On machines where char is unsigned this could lead to option parsing looping
endlessly. It's also too narrow a type on other hardware.

Found via Tom Lane's monitoring of the buildfarm.

Reported-by: Tom Lane <[email protected]>
Security: CVE-2025-1094
Backpatch-through: 13

src/test/modules/test_escape/test_escape.c

index 6654ab1dbe7d35f5b9d9a41c3ea2b9a5b2e03497..3ed70436155ab710e616032b0742feb63436ce43 100644 (file)
@@ -740,7 +740,7 @@ int
 main(int argc, char *argv[])
 {
    pe_test_config tc = {0};
-   char        c;
+   int         c;
    int         option_index;
 
    static const struct option long_options[] = {