修复写越界问题。
This commit is contained in:
15
cache/src/tango_cache_pending.cpp
vendored
15
cache/src/tango_cache_pending.cpp
vendored
@@ -1,9 +1,10 @@
|
|||||||
#include"tango_cache_pending.h"
|
#include "tango_cache_pending.h"
|
||||||
#include<assert.h>
|
#include <tfe_utils.h>
|
||||||
#include<string.h>
|
#include <assert.h>
|
||||||
#include<stdlib.h>
|
#include <string.h>
|
||||||
#include<stdio.h>
|
#include <stdlib.h>
|
||||||
#include<stdbool.h>
|
#include <stdio.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
||||||
time_t get_time_value(const char* field_value, const char* field_type)
|
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 += strlen(field_type);
|
||||||
field_value++;
|
field_value++;
|
||||||
int len = strlen(field_value);
|
int len = strlen(field_value);
|
||||||
time_value = (char *)malloc(sizeof(char)*len);
|
time_value = ALLOC(char, len+1);
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (field_value[index] != ',' && field_value[index] != '\r' && index < len)
|
while (field_value[index] != ',' && field_value[index] != '\r' && index < len)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user