forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit01e51ed
committed
Replace static buf with a stack-allocated one in 'seg' extension
The buffer is used only locally within the function. Also, theinitialization to '0' characters was unnecessary, the initial contentwere always overwritten with sprintf(). I don't understand why it wasdone that way, but it's been like that since forever.In the passing, change from sprintf() to snprintf(). The buffer waslong enough so sprintf() was fine, but this makes it more obvious thatthere's no risk of a buffer overflow.Reviewed-by: Robert HaasDiscussion:https://www.postgresql.org/message-id/7f86e06a-98c5-4ce3-8ec9-3885c8de0358@iki.fi1 parentda8a587 commit01e51ed
1 file changed
+4
-10
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 | 32 |
| |
41 | 33 |
| |
42 | 34 |
| |
| |||
69 | 61 |
| |
70 | 62 |
| |
71 | 63 |
| |
| 64 | + | |
| 65 | + | |
72 | 66 |
| |
73 | 67 |
| |
74 |
| - | |
| 68 | + | |
75 | 69 |
| |
76 |
| - | |
| 70 | + | |
77 | 71 |
| |
78 | 72 |
| |
79 | 73 |
| |
|
0 commit comments
Comments
(0)