forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9b4bf51
committed
ecpg: fix some minor mishandling of bad input in preprocessor.
Avoid null-pointer crash when considering a cursor declarationthat's outside any C function (a case which is useless anyway).Ensure a cursor for a prepared statement is marked as initiallynot open. At worst, if we chanced to get not-already-zeroed memoryfrom malloc(), this oversight would result in failing to issue a"cursor "foo" has been declared but not opened" warning that wouldhave been appropriate.Avoid running off the end of the buffer when there are mismatchedsquare brackets following a variable name. This could lead toSIGSEGV after reaching the end of memory.Given the lack of field complaints, none of these seem to be worthback-patching, but let's clean them up in HEAD.Per valgrind testing by Alexander Lakhin.Discussion:https://postgr.es/m/5f5bcecd-d7ec-b8c0-6c92-d1a7c6e0f639@gmail.com1 parent79fa7b3 commit9b4bf51
File tree
3 files changed
+6
-1
lines changed- src/interfaces/ecpg/preproc
3 files changed
+6
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
432 | 432 |
| |
433 | 433 |
| |
434 | 434 |
| |
435 |
| - | |
| 435 | + | |
| 436 | + | |
436 | 437 |
| |
437 | 438 |
| |
438 | 439 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
| 436 | + | |
436 | 437 |
| |
437 | 438 |
| |
438 | 439 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
216 | 216 |
| |
217 | 217 |
| |
218 | 218 |
| |
| 219 | + | |
| 220 | + | |
| 221 | + | |
219 | 222 |
| |
220 | 223 |
| |
221 | 224 |
| |
|
0 commit comments
Comments
(0)