Re: [PATCH] imap-send: handle NULL return of next_arg()

2017-11-02 Thread René Scharfe
Am 02.11.2017 um 03:18 schrieb Junio C Hamano: > René Scharfe writes: > >> @@ -807,6 +816,8 @@ static int get_cmd_result(struct imap_store *ctx, struct >> imap_cmd *tcmd) >> if (cmdp->cb.cont || cmdp->cb.data) >> imap->literal_pending = 0; >>

Re: [PATCH] imap-send: handle NULL return of next_arg()

2017-11-01 Thread Junio C Hamano
René Scharfe writes: > @@ -807,6 +816,8 @@ static int get_cmd_result(struct imap_store *ctx, struct > imap_cmd *tcmd) > if (cmdp->cb.cont || cmdp->cb.data) > imap->literal_pending = 0; > arg = next_arg(&cmd); > +

[PATCH] imap-send: handle NULL return of next_arg()

2017-11-01 Thread René Scharfe
next_arg() returns NULL if it runs out of arguments. Most call sites already handle that gracefully. Check in the remaining cases as well. Replace the NULL pointer with an empty string at the bottom of get_cmd_result() -- it's nicely reported as an unexpected response a few lines down. Error out