[PATCH] imap-send: properly error out if imap.host is not set in config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If no imap host is specified in the git config, git imap-send used
to try to lookup a null pointer through gethostbyname(), causing a
segfault.  Since setting the imap.host variable is mandatory,
imap-send now properly fails with an explanatory error message.

The problem has been reported by picca through
 http://bugs.debian.org/472632

Signed-off-by: Gerrit Pape <pape@xxxxxxxxxxx>
---
 imap-send.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/imap-send.c b/imap-send.c
index 10cce15..04afbc4 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -1302,6 +1302,10 @@ main(int argc, char **argv)
 		fprintf( stderr, "no imap store specified\n" );
 		return 1;
 	}
+	if (!server.host) {
+		fprintf( stderr, "no imap host specified\n" );
+		return 1;
+	}
 
 	/* read the messages */
 	if (!read_message( stdin, &all_msgs )) {
-- 
1.5.4.4

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux