diff mbox series

[meta-networking,2/9] ssmtp: Fix null pointer assignments

Message ID 20220826061150.3030485-2-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/9] fio: Fix additional warnings seen with musl | expand

Commit Message

Khem Raj Aug. 26, 2022, 6:11 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...e-null-pointer-assignment-to-char-po.patch | 51 +++++++++++++++++++
 .../recipes-support/ssmtp/ssmtp_2.64.bb       |  3 +-
 2 files changed, 53 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-support/ssmtp/ssmtp/0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/ssmtp/ssmtp/0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch b/meta-networking/recipes-support/ssmtp/ssmtp/0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch
new file mode 100644
index 0000000000..c7468fe17f
--- /dev/null
+++ b/meta-networking/recipes-support/ssmtp/ssmtp/0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch
@@ -0,0 +1,51 @@ 
+From 58cfb4f86b7fbf19eb643dfba87fdd890b3d4a4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 24 Aug 2022 19:27:31 -0700
+Subject: [PATCH] ssmtp: Correct the null pointer assignment to char pointers
+
+Fixes
+error: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'char' [-Wint-conversion]
+| char *from = (char)NULL;                /* Use this as the From: address */
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ssmtp.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/ssmtp.c b/ssmtp.c
+index a74ba4e..0a719ac 100644
+--- a/ssmtp.c
++++ b/ssmtp.c
+@@ -55,21 +55,21 @@ bool_t use_oldauth = False;		/* use old AUTH LOGIN username style */
+ 
+ #define ARPADATE_LENGTH 32		/* Current date in RFC format */
+ char arpadate[ARPADATE_LENGTH];
+-char *auth_user = (char)NULL;
+-char *auth_pass = (char)NULL;
+-char *auth_method = (char)NULL;		/* Mechanism for SMTP authentication */
+-char *mail_domain = (char)NULL;
+-char *from = (char)NULL;		/* Use this as the From: address */
++char *auth_user = NULL;
++char *auth_pass = NULL;
++char *auth_method = NULL;		/* Mechanism for SMTP authentication */
++char *mail_domain = NULL;
++char *from = NULL;		/* Use this as the From: address */
+ char *hostname;
+ char *mailhost = "mailhub";
+-char *minus_f = (char)NULL;
+-char *minus_F = (char)NULL;
++char *minus_f = NULL;
++char *minus_F = NULL;
+ char *gecos;
+-char *prog = (char)NULL;
++char *prog = NULL;
+ char *root = NULL;
+ char *tls_cert = "/etc/ssl/certs/ssmtp.pem";	/* Default Certificate */
+-char *uad = (char)NULL;
+-char *config_file = (char)NULL;		/* alternate configuration file */
++char *uad = NULL;
++char *config_file = NULL;		/* alternate configuration file */
+ 
+ headers_t headers, *ht;
+ 
diff --git a/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb b/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
index b0e921d423..05d2bb18ff 100644
--- a/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
+++ b/meta-networking/recipes-support/ssmtp/ssmtp_2.64.bb
@@ -7,7 +7,8 @@  SRC_URI = "${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.bz2 \
            file://ssmtp-bug584162-fix.patch \
            file://build-ouside_srcdir.patch \
            file://use-DESTDIR.patch \
-"
+           file://0001-ssmtp-Correct-the-null-pointer-assignment-to-char-po.patch \
+           "
 
 SRC_URI[md5sum] = "65b4e0df4934a6cd08c506cabcbe584f"
 SRC_URI[sha256sum] = "22c37dc90c871e8e052b2cab0ad219d010fa938608cd66b21c8f3c759046fa36"