]> git.ipfire.org Git - thirdparty/freeswitch.git/commit
Avoid using undefined memory in `switch_fulldate_cmp`
authorTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 00:47:22 +0000 (00:47 +0000)
committerTravis Cross <tc@traviscross.com>
Fri, 22 Aug 2014 00:47:22 +0000 (00:47 +0000)
commitb5a87aea7f89e1e809e1e9660d882ec0959c5890
tree6692d0b5e4ae663aaf23ce322f5d23e8da308c83
parentbf42dd65f1a13725c74f5f151aab99cfca11c434
Avoid using undefined memory in `switch_fulldate_cmp`

The `switch_split_date` and `switch_split_time` functions only set as
many variables as they believe exist values in the input string.
Since we didn't have defaults assigned we would read undefined stack
memory if the input string didn't contain e.g. an hour.

With this commit, we use 1970 if no year is present, January if no
month is present, the first day of the month if none is given, and
zero for each of a missing hour, minute, or second.
src/switch_utils.c