{"thread":{"id":"12876","subject":"[PATCH] imap-send: properly error out if imap.host is not set in config","startedAt":"2008-03-26T18:05:17Z","lastAt":"2008-03-26T18:05:17Z","messageCount":1,"participants":["Gerrit Pape"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"73147","messageId":"20080326180517.23968.qmail@945917b39a7083.315fe32.mid.smarden.org","threadId":"12876","inReplyTo":null,"subject":"[PATCH] imap-send: properly error out if imap.host is not set in config","fromName":"Gerrit Pape","fromEmail":"pape@smarden.org","sentAt":"2008-03-26T18:05:17Z","receivedAt":"2008-03-26T18:05:17Z","isPatch":true,"sender":{"key":"pape@smarden.org","avatar":"https://avatars.githubusercontent.com/u/143170252?v=4"},"body":"If no imap host is specified in the git config, git imap-send used\nto try to lookup a null pointer through gethostbyname(), causing a\nsegfault.  Since setting the imap.host variable is mandatory,\nimap-send now properly fails with an explanatory error message.\n\nThe problem has been reported by picca through\n http://bugs.debian.org/472632\n\nSigned-off-by: Gerrit Pape <pape@smarden.org>\n---\n imap-send.c |    4 ++++\n 1 files changed, 4 insertions(+), 0 deletions(-)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex 10cce15..04afbc4 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -1302,6 +1302,10 @@ main(int argc, char **argv)\n \t\tfprintf( stderr, \"no imap store specified\\n\" );\n \t\treturn 1;\n \t}\n+\tif (!server.host) {\n+\t\tfprintf( stderr, \"no imap host specified\\n\" );\n+\t\treturn 1;\n+\t}\n \n \t/* read the messages */\n \tif (!read_message( stdin, &all_msgs )) {\n-- \n1.5.4.4\n"}]}