Hi,
This warning is generated for hbpgsql library:
../../../postgres.c: In function ‘HB_FUN_PQESCAPEBYTEA’:
../../../postgres.c:816: warning: dereferencing type-punned pointer will break
strict-aliasing rules
This is real bug and definitely has to be fixed, it passes pointer
to HB_SIZE casted to pointer to size_t. On platforms like Win64 it's
buffer overflow bug.
Can someone familiar with this code fix it?
i.e. it may looks like:
HB_FUNC( PQESCAPEBYTEA ) /* deprecated */
{
size_t from_length = ( size_t ) hb_parclen( 1 );
size_t to_length = from_length * 5 + 1;
unsigned char * to = PQescapeBytea( ( const unsigned char * ) hb_parcx( 1 ),
from_length, &to_length );
hb_retclen( ( char * ) to, to_length );
PQfreemem( to );
}
best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour