freebsd-ports/mail/dbmail20/files/patch-2.0.7_005_277
Pav Lucistnik efc03a7db4 - Integrate vendor patches:
1. #266 - Excessive db connects and quits
  2. #271 - BUG with connect to postgresql database
  3. #272 - Non-UTF characters in a message's body
  4. #277 - Fix "INTERNALDATE" calculation in imaputil.c
  5. other patches from repository.
- Add SHA256

PR:		ports/88277
Submitted by:	Mark Starovoytov <mark_sf@kikg.ifmo.ru> (maintainer)
2005-11-15 00:10:58 +00:00

38 lines
1.1 KiB
Text

--- imapcommands.c (revision 1904)
+++ imapcommands.c (revision 1905)
@@ -1787,6 +1787,8 @@
if (args[i + 1]) {
struct tm tm;
+ memset(&tm, 0, sizeof(struct tm));
+
if (strptime(args[i], "%d-%b-%Y %T", &tm) != NULL)
strftime(sqldate,
sizeof(sqldate), "%Y-%m-%d %H:%M:%S",
--- imaputil.c (revision 1904)
+++ imaputil.c (revision 1905)
@@ -1788,13 +1788,14 @@
time_t ltime;
char *last;
+ memset(&tm_sql_date, 0, sizeof(struct tm));
+
last = strptime(sqldate,"%Y-%m-%d %T", &tm_sql_date);
if ( (last == NULL) || (*last != '\0') ) {
strcpy(_imapdate, IMAP_STANDARD_DATE);
return _imapdate;
}
- /* FIXME: this works fine on linux, but may cause dst offsets in netbsd. */
ltime = mktime (&tm_sql_date);
tm_imap_date = localtime(&ltime);
@@ -1814,6 +1815,8 @@
struct tm tm;
char *last_char;
+ memset(&tm, 0, sizeof(struct tm));
+
last_char = strptime(imapdate, "%d-%b-%Y", &tm);
if (last_char == NULL || *last_char != '\0') {
trace(TRACE_DEBUG, "%s,%s: error parsing IMAP date %s",