Commit 82b0a595 authored by Shane Snyder's avatar Shane Snyder
Browse files

bug fix in obfuscating darshan file record names

parent dbefada8
...@@ -144,16 +144,17 @@ void obfuscate_filenames(int key, struct darshan_record_ref *rec_hash) ...@@ -144,16 +144,17 @@ void obfuscate_filenames(int key, struct darshan_record_ref *rec_hash)
{ {
struct darshan_record_ref *ref, *tmp; struct darshan_record_ref *ref, *tmp;
uint32_t hashed; uint32_t hashed;
char tmp_string[32]; char tmp_string[128] = {0};
HASH_ITER(hlink, rec_hash, ref, tmp) HASH_ITER(hlink, rec_hash, ref, tmp)
{ {
hashed = darshan_hashlittle(ref->, strlen(ref->, key); hashed = darshan_hashlittle(ref->, strlen(ref->, key);
sprintf(tmp_string, "%u", hashed); sprintf(tmp_string, "%u", hashed);
free(ref->; free(ref->;
ref-> = malloc(strlen(tmp_string)); ref-> = malloc(strlen(tmp_string) + 1);
assert(ref->; assert(ref->;
memcpy(ref->, tmp_string, strlen(tmp_string)); memcpy(ref->, tmp_string, strlen(tmp_string));
ref->[strlen(tmp_string)] = '\0';
} }
return; return;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment