This is a discussion on ecpg: fix ECPGstore_input() within the Pgsql Patches forums, part of the PostgreSQL category; --> This patch fixes the following issues in ECPGstore_input(): - strlen() was invoked on the NULL pointer for the first ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| This patch fixes the following issues in ECPGstore_input(): - strlen() was invoked on the NULL pointer for the first iteration of the loop (line 875, 923, 966, 1009) - `nval' is freed for every iteration of the loop at 864, but only initialized once outside the loop, resulting in potential multiple free()'s, as well as the use of a freed variable in subsequent iterations - `str' was leaked for every subsequent iteration of the loop (line 871, 920, 963, 1006) - the return value of PGTYPESinterval_to_asc() is leaked at line 920 and 937; the return value of PGTYPESdate_to_asc() is leaked at line 963 and 980; the return value of PGTYPEStimestamp_to_asc() is leaked at line 1006 and 1023. - malloc failure is in general not handled well; the function simply returns without bothering to clean up allocated resources, and many return values are not checked for errors. Also, in create_statement(), `*stmt' was dereferenced before being initialized. Per the Coverity report run by EnterpriseDB. Thanks to Eric Astor at EDB for an initial version of this patch -- the attached version has been improved by myself. Barring any objections, I'd like to apply this to CVS in a day or two (I want to test it first, which I haven't yet done). -Neil ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings |
| Thread Tools | |
| Display Modes | |
|
|