]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Terminate buffers!
authorEliot Gable <egable@gmail.com>
Mon, 8 Oct 2012 22:48:26 +0000 (22:48 +0000)
committerEliot Gable <egable@gmail.com>
Mon, 8 Oct 2012 22:48:26 +0000 (22:48 +0000)
src/switch_pgsql.c

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