forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork0
Commit0182438
committed
Prevent potential overruns of fixed-size buffers.
Coverity identified a number of places in which it couldn't prove that astring being copied into a fixed-size buffer would fit. We believe thatmost, perhaps all of these are in fact safe, or are copying data that iscoming from a trusted source so that any overrun is not really a securityissue. Nonetheless it seems prudent to forestall any risk by usingstrlcpy() and similar functions.Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports.In addition, fix a potential null-pointer-dereference crash incontrib/chkpass. The crypt(3) function is defined to return NULL onfailure, but chkpass.c didn't check for that before using the result.The main practical case in which this could be an issue is if libc isconfigured to refuse to execute unapproved hashing algorithms (e.g.,"FIPS mode"). This ideally should've been a separate commit, butsince it touches code adjacent to one of the buffer overrun changes,I included it in this commit to avoid last-minute merge issues.This issue was reported by Honza Horak.Security:CVE-2014-0065 for buffer overruns,CVE-2014-0066 for crypt()1 parent31400a6 commit0182438
File tree
13 files changed
+46
-29
lines changed- contrib
- chkpass
- pg_standby
- src
- backend
- access/transam
- tsearch
- utils/adt
- bin
- initdb
- pg_basebackup
- common
- interfaces
- ecpg/preproc
- libpq
- test/regress
- timezone
13 files changed
+46
-29
lines changedLines changed: 20 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
94 | 94 |
| |
95 | 95 |
| |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
| 98 | + | |
98 | 99 |
| |
99 | 100 |
| |
100 | 101 |
| |
101 |
| - | |
| 102 | + | |
| 103 | + | |
102 | 104 |
| |
103 | 105 |
| |
104 | 106 |
| |
| |||
148 | 150 |
| |
149 | 151 |
| |
150 | 152 |
| |
| 153 | + | |
151 | 154 |
| |
152 | 155 |
| |
153 |
| - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 |
| |
155 | 164 |
| |
156 | 165 |
| |
| |||
160 | 169 |
| |
161 | 170 |
| |
162 | 171 |
| |
| 172 | + | |
163 | 173 |
| |
164 | 174 |
| |
165 |
| - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
166 | 182 |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
327 | 327 |
| |
328 | 328 |
| |
329 | 329 |
| |
330 |
| - | |
| 330 | + | |
331 | 331 |
| |
332 | 332 |
| |
333 | 333 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5844 | 5844 |
| |
5845 | 5845 |
| |
5846 | 5846 |
| |
5847 |
| - | |
| 5847 | + | |
5848 | 5848 |
| |
5849 | 5849 |
| |
5850 | 5850 |
| |
| |||
6311 | 6311 |
| |
6312 | 6312 |
| |
6313 | 6313 |
| |
6314 |
| - | |
| 6314 | + | |
6315 | 6315 |
| |
6316 | 6316 |
| |
6317 | 6317 |
| |
| |||
9107 | 9107 |
| |
9108 | 9108 |
| |
9109 | 9109 |
| |
9110 |
| - | |
| 9110 | + | |
9111 | 9111 |
| |
9112 | 9112 |
| |
9113 | 9113 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
255 | 255 |
| |
256 | 256 |
| |
257 | 257 |
| |
258 |
| - | |
| 258 | + | |
259 | 259 |
| |
260 | 260 |
| |
261 | 261 |
| |
|
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
89 | 89 |
| |
90 | 90 |
| |
91 | 91 |
| |
92 |
| - | |
| 92 | + | |
93 | 93 |
| |
94 |
| - | |
95 |
| - | |
| 94 | + | |
| 95 | + | |
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
110 |
| - | |
| 110 | + | |
111 | 111 |
| |
112 | 112 |
| |
113 | 113 |
| |
| |||
187 | 187 |
| |
188 | 188 |
| |
189 | 189 |
| |
190 |
| - | |
| 190 | + | |
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
| |||
4215 | 4215 |
| |
4216 | 4216 |
| |
4217 | 4217 |
| |
| 4218 | + | |
4218 | 4219 |
| |
4219 | 4220 |
| |
4220 | 4221 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| |||
375 | 375 |
| |
376 | 376 |
| |
377 | 377 |
| |
378 |
| - | |
| 378 | + | |
379 | 379 |
| |
380 | 380 |
| |
381 | 381 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
921 | 921 |
| |
922 | 922 |
| |
923 | 923 |
| |
924 |
| - | |
| 924 | + | |
925 | 925 |
| |
926 |
| - | |
| 926 | + | |
927 | 927 |
| |
928 | 928 |
| |
929 | 929 |
| |
| |||
1454 | 1454 |
| |
1455 | 1455 |
| |
1456 | 1456 |
| |
1457 |
| - | |
| 1457 | + | |
1458 | 1458 |
| |
1459 | 1459 |
| |
1460 | 1460 |
| |
| |||
1565 | 1565 |
| |
1566 | 1566 |
| |
1567 | 1567 |
| |
1568 |
| - | |
| 1568 | + | |
1569 | 1569 |
| |
1570 | 1570 |
| |
1571 | 1571 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| |||
277 | 277 |
| |
278 | 278 |
| |
279 | 279 |
| |
280 |
| - | |
| 280 | + | |
281 | 281 |
| |
282 | 282 |
| |
283 | 283 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1334 | 1334 |
| |
1335 | 1335 |
| |
1336 | 1336 |
| |
1337 |
| - | |
| 1337 | + | |
1338 | 1338 |
| |
1339 | 1339 |
| |
1340 | 1340 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
500 | 500 |
| |
501 | 501 |
| |
502 | 502 |
| |
503 |
| - | |
| 503 | + | |
504 | 504 |
| |
505 | 505 |
| |
506 | 506 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
206 | 206 |
| |
207 | 207 |
| |
208 | 208 |
| |
209 |
| - | |
| 209 | + | |
210 | 210 |
| |
211 | 211 |
| |
212 | 212 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1221 | 1221 |
| |
1222 | 1222 |
| |
1223 | 1223 |
| |
1224 |
| - | |
| 1224 | + | |
1225 | 1225 |
| |
1226 | 1226 |
| |
1227 | 1227 |
| |
| |||
1276 | 1276 |
| |
1277 | 1277 |
| |
1278 | 1278 |
| |
1279 |
| - | |
| 1279 | + | |
1280 | 1280 |
| |
1281 | 1281 |
| |
1282 | 1282 |
| |
| |||
1304 | 1304 |
| |
1305 | 1305 |
| |
1306 | 1306 |
| |
1307 |
| - | |
| 1307 | + | |
1308 | 1308 |
| |
1309 | 1309 |
| |
1310 | 1310 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 |
| - | |
| 86 | + | |
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
|
0 commit comments
Comments
(0)