mandrakos/pg_idl

Segfault in GetArrayDims

Closed this issue · 0 comments

Appears to happen when all rows of a column are null? Static analysis from splint:

pgsql_query_util.c: (in function GetArrayDims)
pgsql_query_util.c:438:30: Function ntohl expects arg 1 to be uint32_t gets
int32: (int32 )(mptr + 0 * sizeof(int32))
pgsql_query_util.c:440:38: Return value (type int) ignored: fflush(stdout)
pgsql_query_util.c:445:36: Function calloc expects arg 1 to be size_t gets long
int: ndim + 1
To allow arbitrary integral types to match long unsigned, use +longintegral.
pgsql_query_util.c:446:9: Index of possibly null pointer dims: dims
A possibly null pointer is dereferenced. Value is either the result of a
function which may return null (in which case, code should check it is not
null), or a global, parameter or structure field declared with the null
qualifier. (Use -nullderef to inhibit warning)
pgsql_query_util.c:445:16: Storage dims may become null
pgsql_query_util.c:450:35: Function ntohl expects arg 1 to be uint32_t gets
int32: (int32 )(mptr + pos * sizeof(int32))
pgsql_query_util.c:453:60: Return value (type int) ignored: fflush(stdout)
pgsql_query_util.c:459:49: Return value (type int) ignored: fflush(stdout)
pgsql_query_util.c:461:11: Null storage dims returned as non-null: (dims)
Function returns a possibly null pointer, but is not declared using
/
@null@
/ annotation of result. If function may return NULL, add /
@null@
/
annotation to the return value declaration. (Use -nullret to inhibit warning)
pgsql_query_util.c:435:20: Storage dims becomes null