diff --git a/ChangeLog b/ChangeLog index 30fa63a1..37367ad4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-06-11 Federico Di Gregorio + + * Applied patch from wkv to avoid off by one allocation of + connection encoding string (Closes: #109). + 2006-06-09 Federico Di Gregorio * Release 2.0.1. diff --git a/psycopg/connection_int.c b/psycopg/connection_int.c index 1aa20fb7..3e61ddf1 100644 --- a/psycopg/connection_int.c +++ b/psycopg/connection_int.c @@ -112,7 +112,7 @@ conn_connect(connectionObject *self) return -1; } tmp = PQgetvalue(pgres, 0, 0); - self->encoding = PyMem_Malloc(strlen(tmp)); + self->encoding = PyMem_Malloc(strlen(tmp)+1); if (self->encoding == NULL) { /* exception already set by PyMem_Malloc() */ PQfinish(pgconn);