Re: [PATCH] Memory leak in libPQquoteBytea-FU0lM6MGY0+V/[email protected]

Gerhard Häring <[email protected]>
Newsgroups gmane.comp.python.db.pypgsql.user
Message-ID <[email protected]>
Laurent,

thanks for the patch. Just want to assure I'm not missing something:

Pinchart, Laurent wrote:
> Here's a patch that fixes a memory leak in [email protected]

It's not a memory leak, it's a potential buffer overrun, right?

> Bytea are quoted using as much as 5 bytes per input byte (0x00 is quoted
> '\\000'), so allocating (slen * 4) + 3 is not enough for data that contain
> lots of 0x00 bytes.
> 
> The patch has been tested on Windows, with PyPgSQL compiled with VS6.

-- Gerhard



-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.