Skip to content

Commit

Permalink
Ensure that gnc_timespec_to_iso8601_buff's buff is initialized empty.
Browse files Browse the repository at this point in the history
So that there's no trailing garbage on the string.
  • Loading branch information
jralls committed Apr 28, 2015
1 parent 83f2627 commit 32852ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libqof/qof/gnc-date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,7 @@ gnc_timespec_to_iso8601_buff (Timespec ts, char * buff)

if (! buff) return NULL;

memset(buff, 0, max_iso_date_length + 1);
char* str = gnc_print_time64(ts.tv_sec, fmt1.c_str());
strncpy (buff, str, max_iso_date_length);
free(str);
Expand Down

0 comments on commit 32852ec

Please sign in to comment.