diff options
author | unknown <tsmith@quadxeon.mysql.com> | 2007-05-18 06:14:37 +0200 |
---|---|---|
committer | unknown <tsmith@quadxeon.mysql.com> | 2007-05-18 06:14:37 +0200 |
commit | 9548a0757a0a4c1f018365347fc626167b8d148f (patch) | |
tree | 5ffa83e7b2e5ed16b6eff1a0829697c7ffdceeae /sql-common/my_time.c | |
parent | 2738ca56214d221bfb4bff65d09bc2c237be3d1d (diff) | |
download | mariadb-git-9548a0757a0a4c1f018365347fc626167b8d148f.tar.gz |
my_time.c:
in number_to_datetime(), zero out the MYSQL_TIME structure
before setting values, to ensure that all fields are initialized; in
particular, ensure that ->neg is set to zero (fixes valgrind warning
"Conditional jump ... depends on uninitialised value" in make_date_time)
sql-common/my_time.c:
in number_to_datetime(), zero out the MYSQL_TIME structure
before setting values, to ensure that all fields are initialized; in
particular, ensure that ->neg is set to zero (fixes valgrind warning
"Conditional jump ... depends on uninitialised value" in make_date_time)
Diffstat (limited to 'sql-common/my_time.c')
-rw-r--r-- | sql-common/my_time.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 4a4ebf4b84d..f5d5828e024 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -1152,6 +1152,7 @@ longlong number_to_datetime(longlong nr, MYSQL_TIME *time_res, ok: part1=(long) (nr/LL(1000000)); part2=(long) (nr - (longlong) part1*LL(1000000)); + bzero((char*) time_res, sizeof(*time_res)); time_res->year= (int) (part1/10000L); part1%=10000L; time_res->month= (int) part1 / 100; time_res->day= (int) part1 % 100; |