浏览代码

acc: acc_db_set_table_name fixup

- add termination char to db_table_name_buf
Federico Cabiddu 12 年之前
父节点
当前提交
7ba6cbfcaf
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/acc/acc_logic.c

+ 2 - 0
modules/acc/acc_logic.c

@@ -197,6 +197,8 @@ int acc_db_set_table_name(struct sip_msg *msg, void *param, str *table)
 			return -1;
 		}
 		strncpy(db_table_name_buf, dbtable.s, dbtable.len);
+                /* FS#327: since the buffer is static terminate the table name */
+                db_table_name_buf[dbtable.len] = '\0';
 		env_set_text(db_table_name_buf, dbtable.len);
 	} else {
 		if(table==NULL) {