]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Put a memset in ast_localtime() instead of a couple places in app_voicemail
authorRussell Bryant <russell@russellbryant.com>
Mon, 17 Sep 2007 20:16:25 +0000 (20:16 +0000)
committerRussell Bryant <russell@russellbryant.com>
Mon, 17 Sep 2007 20:16:25 +0000 (20:16 +0000)
to prevent the problem everywhere instead of just a couple of places.
(related to issue #10746)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82676 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c
main/stdtime/localtime.c

index d3d29e60651cb46a5d0c7926582d06daeb7cc9bc..fe55a5019719414893238617f691f9e35b566fc9 100644 (file)
@@ -1783,8 +1783,6 @@ static void make_email_file(FILE *p, char *srcemail, struct ast_vm_user *vmu, in
 #define ENDL "\n"
 #endif
 
-       memset(&tm, 0, sizeof(tm));
-
        gethostname(host, sizeof(host) - 1);
        if (strchr(srcemail, '@'))
                ast_copy_string(who, srcemail, sizeof(who));
@@ -2053,7 +2051,6 @@ static int get_date(char *s, int len)
        time_t t;
 
        time(&t);
-       memset(&tm, 0, sizeof(tm));
 
        ast_localtime(&t, &tm, NULL);
 
index 9ecfa0a70b7573429ea52414c7984569121c204d..1922e4a22d1828549b37bec4dcc131e6691083f7 100644 (file)
@@ -1142,6 +1142,7 @@ static struct tm *localsub(const time_t *timep, const long offset, struct tm *tm
 struct tm *ast_localtime(const time_t *timep, struct tm *tmp, const char *zone)
 {
        const struct state *sp = ast_tzset(zone);
+       memset(tmp, 0, sizeof(*tmp));
        return sp ? localsub(timep, 0L, tmp, sp) : NULL;
 }