diff --git a/src/entry/Maat_stat.cpp b/src/entry/Maat_stat.cpp index 8bdd7e0..60f8fdd 100644 --- a/src/entry/Maat_stat.cpp +++ b/src/entry/Maat_stat.cpp @@ -23,6 +23,7 @@ enum MAAT_FS_COLUMN COLUMN_TABLE_CPU_TIME,//microseconds COLUMN_TABLE_HIT_CNT, }; +#define MAX_CONJ_NAME_LEN 22 void maat_stat_init(struct _Maat_feather_t* feather) { int value=0; @@ -101,7 +102,11 @@ void maat_stat_init(struct _Maat_feather_t* feather) offset+=snprintf(conj_table_name+offset,sizeof(conj_table_name)-offset ,"%s/",p_table->table_name[j]); } - conj_table_name[j]='\0';//delete the last slash + conj_table_name[offset-1]='\0';//delete the last slash + if(strlen(conj_table_name)>MAX_CONJ_NAME_LEN) + { + snprintf(conj_table_name+MAX_CONJ_NAME_LEN-2,sizeof(conj_table_name)-MAX_CONJ_NAME_LEN-2,".."); + } p_table->stat_line_id=FS_register(feather->stat_handle , FS_STYLE_LINE, FS_CALC_CURRENT ,conj_table_name); diff --git a/src/entry/mesa_fuzzy.c b/src/entry/mesa_fuzzy.c index 88a1b6c..69eab3f 100644 --- a/src/entry/mesa_fuzzy.c +++ b/src/entry/mesa_fuzzy.c @@ -12,7 +12,7 @@ #define INIT_SIZE 128 #define ENTROPY_THRESHOLD 0.5 int count = 0; -const char * b64 = +const char * sfh_b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; @@ -626,17 +626,17 @@ void sfh_output_state(IVI_seg_t * seg, void * user_para) memset(hash_result,0,sizeof(hash_result)); if(seg->left == 0) { - hash_result[j] = b64[zt_hash_code(&(node->ps)) & 0x3F]; + hash_result[j] = sfh_b64[zt_hash_code(&(node->ps)) & 0x3F]; j++; } for(i = 0; i < node->s_cnt; i++,j++) { - hash_result[j] = b64[(node->s_array[i].val) & 0x3F]; + hash_result[j] = sfh_b64[(node->s_array[i].val) & 0x3F]; } hash_result[j+1]='\0'; if(0!=memcmp(&(node->s_state),ZT_INIT_VAL,sizeof(ZT_INIT_VAL))) { - result->last_char=b64[zt_hash_code(&(node->s_state)) & 0x3F]; + result->last_char=sfh_b64[zt_hash_code(&(node->s_state)) & 0x3F]; } else {