diff options
author | Gerrit Pape <pape@smarden.org> | 2008-03-26 19:05:17 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-03-27 00:15:02 +0100 |
commit | 5b67b8e2d4ed8a152694f4555549fcde5dae77f5 (patch) | |
tree | cff59728ab44692d7a2a38b015f674b7e257e1f5 /imap-send.c | |
parent | t9600-cvsimport.sh: set HOME before checking for cvsps availability (diff) | |
download | git-5b67b8e2d4ed8a152694f4555549fcde5dae77f5.tar.xz git-5b67b8e2d4ed8a152694f4555549fcde5dae77f5.zip |
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 <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'imap-send.c')
-rw-r--r-- | imap-send.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c index 10cce15a42..04afbc4924 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 )) { |