Skip to content
  • Jeff King's avatar
    connect.c: handle errors from split_cmdline · 22e5ae5c
    Jeff King authored and Junio C Hamano's avatar Junio C Hamano committed
    Commit e9d9a8a4
    
     (connect: handle putty/plink also in
    GIT_SSH_COMMAND, 2017-01-02) added a call to
    split_cmdline(), but checks only for a non-zero return to
    see if we got any output. Since the function returns
    negative values (and a NULL argv) on error, we end up
    dereferencing NULL and segfaulting.
    
    Arguably we could report on the parsing error here, but it's
    probably not worth it. This is a best-effort attempt to see
    if we are using plink. So we can simply return here with
    "no, it wasn't plink" and let the shell actually complain
    about the bogus quoting.
    
    Reported-by: default avatarÆvar Arnfjörð Bjarmason <avarab@gmail.com>
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    22e5ae5c