Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions darshan-runtime/lib/darshan-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ static void darshan_get_exe_and_mounts(struct darshan_core_runtime *core,
static int darshan_should_instrument_app(struct darshan_core_runtime *core)
{
char *tmp_str;
char *app_name;
char *app_name=NULL;
struct darshan_core_regex *app_regex;
int app_excluded = 0, app_included = 0;

Expand Down Expand Up @@ -2064,7 +2064,8 @@ void darshan_log_finalize(char *logfile_name, double start_log_time)
if(new_logfile_name)
{
/* copy partial log file name over to new string */
strncpy(new_logfile_name, logfile_name, __DARSHAN_PATH_MAX);
strncpy(new_logfile_name, logfile_name, __DARSHAN_PATH_MAX-1);
new_logfile_name[__DARSHAN_PATH_MAX-1] = '\0';
/* retrieve current time stamp */
end_log_time = darshan_core_wtime_absolute();
/* find location of .darshan_partial extension */
Expand Down
2 changes: 1 addition & 1 deletion darshan-util/darshan-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ int main(int argc, char *argv[])
struct darshan_mod_record_ref *mod_rec1, *mod_rec2;
void *mod_buf1, *mod_buf2;
struct darshan_base_record *base_rec1, *base_rec2;
char *file_name1, *file_name2;
char *file_name1=NULL, *file_name2=NULL;
int i;
int ret;

Expand Down
2 changes: 1 addition & 1 deletion darshan-util/darshan-hdf5-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ static void darshan_log_agg_hdf5_files(void *rec, void *agg_rec, int init_flag)
break;
case H5F_F_META_TIME:
/* sum */
agg_hdf5_rec->counters[i] += hdf5_rec->counters[i];
agg_hdf5_rec->fcounters[i] += hdf5_rec->fcounters[i];
break;
default:
agg_hdf5_rec->fcounters[i] = -1;
Expand Down
6 changes: 4 additions & 2 deletions darshan-util/darshan-logutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ darshan_fd darshan_log_open(const char *name)
free(tmp_fd);
return(NULL);
}
strncpy(tmp_fd->state->logfile_path, name, __DARSHAN_PATH_MAX);
strncpy(tmp_fd->state->logfile_path, name, __DARSHAN_PATH_MAX-1);
tmp_fd->state->logfile_path[__DARSHAN_PATH_MAX-1] = '\0';

/* read the header from the log file to init fd data structures */
ret = darshan_log_get_header(tmp_fd);
Expand Down Expand Up @@ -229,7 +230,8 @@ darshan_fd darshan_log_create(const char *name, enum darshan_comp_type comp_type
}
tmp_fd->state->creat_flag = 1;
tmp_fd->partial_flag = partial_flag;
strncpy(tmp_fd->state->logfile_path, name, __DARSHAN_PATH_MAX);
strncpy(tmp_fd->state->logfile_path, name, __DARSHAN_PATH_MAX-1);
tmp_fd->state->logfile_path[__DARSHAN_PATH_MAX-1] = '\0';

/* position file pointer to prealloc space for the log file header
* NOTE: the header is written at close time, after all internal data
Expand Down
Loading