[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 110/125: smtp/pop3/imap_get_message: decrease the d
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 110/125: smtp/pop3/imap_get_message: decrease the data length too... |
Date: |
Sun, 21 Jan 2018 23:42:45 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 8dd4edeb90ab7bb1df5339fd29422860bf86c585
Author: Daniel Stenberg <address@hidden>
AuthorDate: Sat Jan 13 06:35:12 2018 +0100
smtp/pop3/imap_get_message: decrease the data length too...
Follow-up commit to 615edc1f73 which was incomplete.
Assisted-by: Max Dymond
Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5206
---
lib/imap.c | 8 +++++---
lib/pop3.c | 8 +++++---
lib/smtp.c | 8 +++++---
3 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/lib/imap.c b/lib/imap.c
index 63a998b2b..cf278a22b 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -349,11 +349,13 @@ static void imap_get_message(char *buffer, char **outptr)
if(len > 2) {
/* Find the start of the message */
- for(message = buffer + 2; *message == ' ' || *message == '\t'; message++)
+ len -= 2;
+ for(message = buffer + 2; *message == ' ' || *message == '\t';
+ message++, len--)
;
/* Find the end of the message */
- for(len -= 2; len--;)
+ for(; len--;)
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
message[len] != '\t')
break;
diff --git a/lib/pop3.c b/lib/pop3.c
index 40dde1052..78f6afef1 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -248,11 +248,13 @@ static void pop3_get_message(char *buffer, char **outptr)
if(len > 2) {
/* Find the start of the message */
- for(message = buffer + 2; *message == ' ' || *message == '\t'; message++)
+ len -= 2;
+ for(message = buffer + 2; *message == ' ' || *message == '\t';
+ message++, len--)
;
/* Find the end of the message */
- for(len -= 2; len--;)
+ for(; len--;)
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
message[len] != '\t')
break;
diff --git a/lib/smtp.c b/lib/smtp.c
index b31ecb4b0..d9f1a854a 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -237,11 +237,13 @@ static void smtp_get_message(char *buffer, char **outptr)
if(len > 4) {
/* Find the start of the message */
- for(message = buffer + 4; *message == ' ' || *message == '\t'; message++)
+ len -= 4;
+ for(message = buffer + 4; *message == ' ' || *message == '\t';
+ message++, len--)
;
/* Find the end of the message */
- for(len -= 4; len--;)
+ for(; len--;)
if(message[len] != '\r' && message[len] != '\n' && message[len] != ' ' &&
message[len] != '\t')
break;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 88/125: test1554: improve the error handling, (continued)
- [GNUnet-SVN] [gnurl] 88/125: test1554: improve the error handling, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 87/125: test1554: add global initialization and cleanup, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 97/125: easy: fix connection ownership in curl_easy_pause, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 89/125: Revert "curl/system.h: fix compilation with gcc on AIX PPC and IA64 HP-UX", gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 105/125: test394: verify abort of rubbish in Content-Length: value, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 83/125: tool_getparam: Support size modifiers for --max-filesize, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 100/125: setopt: fix SSLVERSION to allow CURL_SSLVERSION_MAX_ values, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 115/125: unit1307: test many wildcards too, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 106/125: test395: HTTP with overflow Content-Length value, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 101/125: RELEASE-NOTES: synced with 6fa10c8fa, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 110/125: smtp/pop3/imap_get_message: decrease the data length too...,
gnunet <=
- [GNUnet-SVN] [gnurl] 91/125: build: remove HAVE_LIMITS_H check, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 113/125: ftp-wildcard: fix matching an empty string with "*[^a]", gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 121/125: http2: don't close connection when single transfer is stopped, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 124/125: RELEASE-NOTES: synced with bb0ffcc36, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 85/125: brotli: data at the end of content can be lost, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 108/125: mime: clone mime tree upon easy handle duplication., gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 48/125: CURLOPT_DNS_CACHE_TIMEOUT.3: see also CURLOPT_RESOLVE, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 63/125: mailmap: added/clarified several names, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 25/125: conncache: fix several lock issues, gnunet, 2018/01/21
- [GNUnet-SVN] [gnurl] 67/125: curl: support >256 bytes warning messsages, gnunet, 2018/01/21