forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8ec00dc
committed
Remove undesirable libpq dependency on stringinfo.c.
Commitc0cb87f unwisely introduced a dependency on the StringInfomachinery in fe-connect.c. We must not use that in libpq, becauseit will do a summary exit(1) if it hits OOM, and that is notappropriate behavior for a general-purpose library. The goal ofallowing arbitrary line lengths in service files doesn't seem likeit's worth a lot of effort, so revert back to the previous methodof using a stack-allocated buffer and failing on buffer overflow.This isn't an exact revert though. I kept that patch's refactoringto have a single exit path, as that seems cleaner than having eacherror path know what to do to clean up. Also, I made the fixed-sizebuffer 1024 bytes not 256, just to push off the need for an expandablebuffer some more.There is more to do here; in particular the lack of any mechanicalcheck for this type of mistake now seems pretty hazardous. But thisfix gets us back to the level of robustness we had in v13, anyway.Discussion:https://postgr.es/m/daeb22ec6ca8ef61e94d766a9b35fb03cabed38e.camel@vmware.com1 parentd5a2c41 commit8ec00dc
1 file changed
+17
-11
lines changedLines changed: 17 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
32 | 31 |
| |
33 | 32 |
| |
34 | 33 |
| |
| |||
5163 | 5162 |
| |
5164 | 5163 |
| |
5165 | 5164 |
| |
5166 |
| - | |
| 5165 | + | |
5167 | 5166 |
| |
5168 | 5167 |
| |
5169 | 5168 |
| |
| |||
5175 | 5174 |
| |
5176 | 5175 |
| |
5177 | 5176 |
| |
5178 |
| - | |
5179 |
| - | |
5180 |
| - | |
| 5177 | + | |
5181 | 5178 |
| |
| 5179 | + | |
| 5180 | + | |
5182 | 5181 |
| |
5183 | 5182 |
| |
5184 |
| - | |
5185 |
| - | |
5186 |
| - | |
5187 |
| - | |
| 5183 | + | |
| 5184 | + | |
| 5185 | + | |
| 5186 | + | |
| 5187 | + | |
| 5188 | + | |
| 5189 | + | |
| 5190 | + | |
| 5191 | + | |
5188 | 5192 |
| |
5189 |
| - | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
5190 | 5197 |
| |
5191 | 5198 |
| |
5192 | 5199 |
| |
| |||
5303 | 5310 |
| |
5304 | 5311 |
| |
5305 | 5312 |
| |
5306 |
| - | |
5307 | 5313 |
| |
5308 | 5314 |
| |
5309 | 5315 |
| |
|
0 commit comments
Comments
(0)