修复写越界问题。
This commit is contained in:
3
cache/src/tango_cache_pending.cpp
vendored
3
cache/src/tango_cache_pending.cpp
vendored
@@ -1,4 +1,5 @@
|
||||
#include "tango_cache_pending.h"
|
||||
#include <tfe_utils.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user