Skip to content

Commit 5b67b8e

Browse files
g-papegitster
authored andcommitted
imap-send: properly error out if imap.host 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 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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 40ae887 commit 5b67b8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

imap-send.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,10 @@ main(int argc, char **argv)
13021302
fprintf( stderr, "no imap store specified\n" );
13031303
return 1;
13041304
}
1305+
if (!server.host) {
1306+
fprintf( stderr, "no imap host specified\n" );
1307+
return 1;
1308+
}
13051309

13061310
/* read the messages */
13071311
if (!read_message( stdin, &all_msgs )) {

0 commit comments

Comments
 (0)