forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitde52198
committed
Fix latent crash in do_text_output_multiline().
do_text_output_multiline() would fail (typically with a null pointerdereference crash) if its input string did not end with a newline. Suchcases do not arise in our current sources; but it certainly could happenin future, or in extension code's usage of the function, so we should fixit. To fix, replace "eol += len" with "eol = text + len".While at it, make two cosmetic improvements: mark the input string const,and rename the argument from "text" to "txt" to dodge pgindent strangeness(since "text" is a typedef name).Even though this problem is only latent at present, it seems like a goodidea to back-patch the fix, since it's a very simple/safe patch and it'snot out of the realm of possibility that we might in future back-patchsomething that expects sane behavior from do_text_output_multiline().Per report from Hao Lee.Report: <CAGoxFiFPAGyPAJLcFxTB5cGhTW2yOVBDYeqDugYwV4dEd1L_Ag@mail.gmail.com>1 parent7ac0342 commitde52198
File tree
2 files changed
+10
-11
lines changed- src
- backend/executor
- include/executor
2 files changed
+10
-11
lines changedLines changed: 9 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1283 | 1283 |
| |
1284 | 1284 |
| |
1285 | 1285 |
| |
1286 |
| - | |
| 1286 | + | |
1287 | 1287 |
| |
1288 | 1288 |
| |
1289 | 1289 |
| |
1290 | 1290 |
| |
1291 |
| - | |
| 1291 | + | |
1292 | 1292 |
| |
1293 |
| - | |
| 1293 | + | |
1294 | 1294 |
| |
1295 | 1295 |
| |
1296 |
| - | |
| 1296 | + | |
1297 | 1297 |
| |
1298 | 1298 |
| |
1299 |
| - | |
1300 |
| - | |
| 1299 | + | |
1301 | 1300 |
| |
1302 | 1301 |
| |
1303 | 1302 |
| |
1304 | 1303 |
| |
1305 |
| - | |
1306 |
| - | |
| 1304 | + | |
| 1305 | + | |
1307 | 1306 |
| |
1308 | 1307 |
| |
1309 |
| - | |
| 1308 | + | |
1310 | 1309 |
| |
1311 | 1310 |
| |
1312 |
| - | |
| 1311 | + | |
1313 | 1312 |
| |
1314 | 1313 |
| |
1315 | 1314 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
276 | 276 |
| |
277 | 277 |
| |
278 | 278 |
| |
279 |
| - | |
| 279 | + | |
280 | 280 |
| |
281 | 281 |
| |
282 | 282 |
| |
|
0 commit comments
Comments
(0)