修复写越界问题。

This commit is contained in:
zhengchao
2018-10-22 15:43:57 +08:00
committed by 陆秋文
parent 207a7af857
commit 0d95a8e54e

View File

@@ -1,9 +1,10 @@
#include"tango_cache_pending.h"
#include<assert.h>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#include<stdbool.h>
#include "tango_cache_pending.h"
#include <tfe_utils.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
time_t get_time_value(const char* field_value, const char* field_type)
@@ -13,7 +14,7 @@ time_t get_time_value(const char* field_value, const char* field_type)
field_value += strlen(field_type);
field_value++;
int len = strlen(field_value);
time_value = (char *)malloc(sizeof(char)*len);
time_value = ALLOC(char, len+1);
int index = 0;
while (field_value[index] != ',' && field_value[index] != '\r' && index < len)
{