path: root/imap-send.c
diff options
authorGerrit Pape <>2008-03-26 18:05:17 (GMT)
committerJunio C Hamano <>2008-03-26 23:15:02 (GMT)
commit5b67b8e2d4ed8a152694f4555549fcde5dae77f5 (patch)
treecff59728ab44692d7a2a38b015f674b7e257e1f5 /imap-send.c
parent40ae8872a1b8ba117e0365832f6621f968b1221e (diff)
imap-send: properly error out if is not set in config
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 variable is mandatory, imap-send now properly fails with an explanatory error message. The problem has been reported by picca through Signed-off-by: Gerrit Pape <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'imap-send.c')
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 (! {
+ fprintf( stderr, "no imap host specified\n" );
+ return 1;
+ }
/* read the messages */
if (!read_message( stdin, &all_msgs )) {