forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitd35cd06
committed
Fix overflow in parsing of positional parameter
Replace atol with pg_strtoint32_safe in the backend parser and withstrtoint in ECPG to reject overflows when parsing the number of apositional parameter. With atol from glibc, parameters $2147483648 and$4294967297 turn into $-2147483648 and $1, respectively.Author: Erik Wienhold <ewie@ewie.name>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Peter Eisentraut <peter@eisentraut.org>Reviewed-by: Alexander Lakhin <exclusion@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/5d216d1c-91f6-4cbe-95e2-b4cbd930520c@ewie.name1 parent4867f8a commitd35cd06
File tree
4 files changed
+19
-2
lines changed- src
- backend/parser
- interfaces/ecpg/preproc
- test/regress
- expected
- sql
4 files changed
+19
-2
lines changedLines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
992 | 992 |
| |
993 | 993 |
| |
994 | 994 |
| |
| 995 | + | |
| 996 | + | |
| 997 | + | |
995 | 998 |
| |
996 |
| - | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
997 | 1003 |
| |
998 | 1004 |
| |
999 | 1005 |
| |
|
Lines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
938 | 938 |
| |
939 | 939 |
| |
940 | 940 |
| |
941 |
| - | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
942 | 948 |
| |
943 | 949 |
| |
944 | 950 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
206 | 206 |
| |
207 | 207 |
| |
208 | 208 |
| |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 |
| |
210 | 214 |
| |
211 | 215 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
55 | 56 |
| |
56 | 57 |
| |
57 | 58 |
| |
|
0 commit comments
Comments
(0)