1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-03-05 18:13:27 +00:00

Terminate buffers!

This commit is contained in:
Eliot Gable 2012-10-08 22:48:26 +00:00
parent e5ddafff1f
commit f059d97ff8

@ -629,10 +629,12 @@ SWITCH_DECLARE(switch_pgsql_status_t) switch_pgsql_handle_callback_exec_detailed
if (tmp) { if (tmp) {
len = strlen(tmp); len = strlen(tmp);
names[col] = malloc(len+1); names[col] = malloc(len+1);
names[col][len] = '\0';
strncpy(names[col], tmp, len); strncpy(names[col], tmp, len);
len = PQgetlength(result->result, row, col); len = PQgetlength(result->result, row, col);
vals[col] = malloc(len+1); vals[col] = malloc(len+1);
vals[col][len] = '\0';
tmp = PQgetvalue(result->result, row, col); tmp = PQgetvalue(result->result, row, col);
strncpy(vals[col], tmp, len); strncpy(vals[col], tmp, len);
} else { } else {