[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 25/73: mime: refuse to add subparts to one of their
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 25/73: mime: refuse to add subparts to one of their own descendants. |
Date: |
Tue, 24 Oct 2017 18:54:06 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit ebcbed3821533a884e18f9441084da9449514fdf
Author: Patrick Monnerat <address@hidden>
AuthorDate: Sun Oct 8 18:49:52 2017 +0100
mime: refuse to add subparts to one of their own descendants.
Reported-by: Alexey Melnichuk
Fixes #1962
---
lib/mime.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/lib/mime.c b/lib/mime.c
index 4b6881703..04746ed09 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -26,6 +26,8 @@
#include "mime.h"
#include "non-ascii.h"
+#include "urldata.h"
+#include "sendf.h"
#if !defined(CURL_DISABLE_HTTP) || !defined(CURL_DISABLE_SMTP) || \
!defined(CURL_DISABLE_IMAP)
@@ -1409,6 +1411,8 @@ CURLcode curl_mime_data_cb(curl_mimepart *part,
curl_off_t datasize,
CURLcode Curl_mime_set_subparts(curl_mimepart *part,
curl_mime *subparts, int take_ownership)
{
+ curl_mime *root;
+
if(!part)
return CURLE_BAD_FUNCTION_ARGUMENT;
@@ -1427,6 +1431,17 @@ CURLcode Curl_mime_set_subparts(curl_mimepart *part,
if(subparts->parent)
return CURLE_BAD_FUNCTION_ARGUMENT;
+ /* Should not be the part's root. */
+ root = part->parent;
+ if(root) {
+ while(root->parent && root->parent->parent)
+ root = root->parent->parent;
+ if(subparts == root) {
+ failf(part->easy, "Can't add itself as a subpart!");
+ return CURLE_BAD_FUNCTION_ARGUMENT;
+ }
+ }
+
subparts->parent = part;
part->readfunc = mime_subparts_read;
part->seekfunc = mime_subparts_seek;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 21/73: curlver.h: next expected release is 7.57.0, (continued)
- [GNUnet-SVN] [gnurl] 21/73: curlver.h: next expected release is 7.57.0, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 27/73: ftpserver: properly reset $ftptargetdir., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 36/73: FTP: URL decode path for dir listing in nocwd mode, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 31/73: openssl: enable PKCS12 support for !BoringSSL, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 40/73: openssl: don't use old BORINGSSL_YYYYMM macros, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 41/73: url: Update current connection SSL verify params in setopt, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 29/73: mime: properly unbind mime structure in curl_mime_free()., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 32/73: FAQ: s/CURLOPT_PROGRESSFUNCTION/CURLOPT_XFERINFOFUNCTION, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 34/73: CURLOPT_XFERINFODATA.3: fix duplicate see also, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 46/73: cli tool: use file2memory() to buffer stdin in -F option., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 25/73: mime: refuse to add subparts to one of their own descendants.,
gnunet <=
- [GNUnet-SVN] [gnurl] 55/73: makefile.m32: allow to override gcc, ar and ranlib, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 50/73: mime: do not call failf() if easy handle is NULL., gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 53/73: runtests: use valgrind for torture as well, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 49/73: test651: curl_formadd with huge COPYCONTENTS, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 63/73: runtests: support MultiSSL client feature, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 58/73: RELEASE-NOTES: synced with f121575c0, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 65/73: mime: do not reuse previously computed multipart size, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 59/73: mime: limit bas64-encoded lines length to 76 characters, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 69/73: mk-ca-bundle: Fix URL for NSS, gnunet, 2017/10/24
- [GNUnet-SVN] [gnurl] 72/73: RELEASE-NOTES: 7.56.1, gnunet, 2017/10/24