forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit47458f8

Neil Conway
GCC 4.0 includes a new warning option, -Wformat-literal, that emits
a warning when a variable is used as a format string for printf()and similar functions (if the variable is derived from untrusteddata, it could include unexpected formatting sequences). Thisemits too many warnings to be enabled by default, but it doesflag a few dubious constructs in the Postgres tree. This patchfixes up the obvious variants: functions that are passed a variableformat string but no additional arguments.Most of these are harmless (e.g. the ruleutils stuff), but thereis at least one actual bug here: if you create a trigger named"%sfoo", pg_dump will read uninitialized memory and fail to dumpthe trigger correctly.1 parent16d4418 commit47458f8
File tree
5 files changed
+22
-24
lines changed- src
- backend/utils/adt
- bin
- initdb
- pg_dump
5 files changed
+22
-24
lines changedLines changed: 11 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
6 |
| - | |
| 6 | + | |
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| |||
733 | 733 |
| |
734 | 734 |
| |
735 | 735 |
| |
736 |
| - | |
| 736 | + | |
737 | 737 |
| |
738 | 738 |
| |
739 | 739 |
| |
| |||
1885 | 1885 |
| |
1886 | 1886 |
| |
1887 | 1887 |
| |
1888 |
| - | |
| 1888 | + | |
1889 | 1889 |
| |
1890 | 1890 |
| |
1891 | 1891 |
| |
| |||
1954 | 1954 |
| |
1955 | 1955 |
| |
1956 | 1956 |
| |
1957 |
| - | |
| 1957 | + | |
1958 | 1958 |
| |
1959 | 1959 |
| |
1960 | 1960 |
| |
| |||
1976 | 1976 |
| |
1977 | 1977 |
| |
1978 | 1978 |
| |
1979 |
| - | |
| 1979 | + | |
1980 | 1980 |
| |
1981 | 1981 |
| |
1982 | 1982 |
| |
| |||
2040 | 2040 |
| |
2041 | 2041 |
| |
2042 | 2042 |
| |
2043 |
| - | |
| 2043 | + | |
2044 | 2044 |
| |
2045 | 2045 |
| |
2046 | 2046 |
| |
| |||
2229 | 2229 |
| |
2230 | 2230 |
| |
2231 | 2231 |
| |
2232 |
| - | |
| 2232 | + | |
2233 | 2233 |
| |
2234 | 2234 |
| |
2235 | 2235 |
| |
| |||
2301 | 2301 |
| |
2302 | 2302 |
| |
2303 | 2303 |
| |
2304 |
| - | |
| 2304 | + | |
2305 | 2305 |
| |
2306 | 2306 |
| |
2307 | 2307 |
| |
| |||
3268 | 3268 |
| |
3269 | 3269 |
| |
3270 | 3270 |
| |
3271 |
| - | |
| 3271 | + | |
3272 | 3272 |
| |
3273 | 3273 |
| |
3274 | 3274 |
| |
| |||
3280 | 3280 |
| |
3281 | 3281 |
| |
3282 | 3282 |
| |
3283 |
| - | |
| 3283 | + | |
3284 | 3284 |
| |
3285 | 3285 |
| |
3286 | 3286 |
| |
| |||
3415 | 3415 |
| |
3416 | 3416 |
| |
3417 | 3417 |
| |
3418 |
| - | |
| 3418 | + | |
3419 | 3419 |
| |
3420 | 3420 |
| |
3421 | 3421 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
| 42 | + | |
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
| |||
2609 | 2609 |
| |
2610 | 2610 |
| |
2611 | 2611 |
| |
2612 |
| - | |
| 2612 | + | |
2613 | 2613 |
| |
2614 | 2614 |
| |
2615 | 2615 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
160 | 160 |
| |
161 | 161 |
| |
162 | 162 |
| |
163 |
| - | |
| 163 | + | |
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
|
Lines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
19 | 19 |
| |
20 | 20 |
| |
21 | 21 |
| |
| |||
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
348 |
| - | |
| 348 | + | |
349 | 349 |
| |
350 | 350 |
| |
351 | 351 |
| |
| |||
2197 | 2197 |
| |
2198 | 2198 |
| |
2199 | 2199 |
| |
2200 |
| - | |
2201 |
| - | |
2202 |
| - | |
| 2200 | + | |
2203 | 2201 |
| |
2204 | 2202 |
| |
2205 | 2203 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
976 | 976 |
| |
977 | 977 |
| |
978 | 978 |
| |
979 |
| - | |
| 979 | + | |
980 | 980 |
| |
981 | 981 |
| |
982 | 982 |
| |
| |||
7599 | 7599 |
| |
7600 | 7600 |
| |
7601 | 7601 |
| |
7602 |
| - | |
| 7602 | + | |
7603 | 7603 |
| |
7604 | 7604 |
| |
7605 | 7605 |
| |
7606 | 7606 |
| |
7607 |
| - | |
| 7607 | + | |
7608 | 7608 |
| |
7609 | 7609 |
| |
7610 | 7610 |
| |
|
0 commit comments
Comments
(0)