diff --git a/mailnews/mime/cthandlers/vcard/mimevcrd.cpp b/mailnews/mime/cthandlers/vcard/mimevcrd.cpp index c11fcbd26c3a..dc13bac81ecc 100644 --- a/mailnews/mime/cthandlers/vcard/mimevcrd.cpp +++ b/mailnews/mime/cthandlers/vcard/mimevcrd.cpp @@ -1730,9 +1730,11 @@ static int WriteLineToStream (MimeObject *obj, const char *line) { int status = 0; char *htmlLine; - int htmlLen ; + int htmlLen =0; - htmlLen = nsCRT::strlen(line) + nsCRT::strlen("
") + 1;; + if (line) htmlLen += nsCRT::strlen(line); + + htmlLen += nsCRT::strlen("
") + 1; htmlLine = (char *) PR_MALLOC (htmlLen); if (htmlLine)