]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Check curl_mime_filedata() return value (CID #1503934) (#4597)
authorJames Jones <jejones3141@gmail.com>
Sat, 23 Jul 2022 11:46:21 +0000 (06:46 -0500)
committerGitHub <noreply@github.com>
Sat, 23 Jul 2022 11:46:21 +0000 (18:46 +0700)
src/modules/rlm_smtp/rlm_smtp.c

index 0c3672d262116d6ec309eb4239375d5cda18abdd..487f84ab151884a094ac3ab54b03d45c6c19592e 100644 (file)
@@ -387,7 +387,10 @@ static int str_to_attachments(fr_mail_ctx_t *uctx, curl_mime *mime, char const *
        /* Add the file attachment as a mime encoded part */
        part = curl_mime_addpart(mime);
        curl_mime_encoder(part, "base64");
-       curl_mime_filedata(part, path_buffer->buff);
+       if (curl_mime_filedata(part, path_buffer->buff) != CURLE_OK) {
+               REDEBUG2("Cannot add file attachment");
+               return 0;
+       }
 
        return 1;
 }