• J
    fast-import: fix read of uninitialized argv memory · ff45c0d4
    Jeff King 提交于
    Fast-import shares code between its command-line parser and
    the "option" command. To do so, it strips the "--" from any
    command-line options and passes them to the option parser.
    However, it does not confirm that the option even begins
    with "--" before blindly passing "arg + 2".
    
    It does confirm that the option starts with "-", so the only
    affected case was:
    
      git fast-import -
    
    which would read uninitialized memory after the argument. We
    can fix it by using skip_prefix and checking the result. As
    a bonus, this gets rid of some magic numbers.
    Signed-off-by: NJeff King <peff@peff.net>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    ff45c0d4
fast-import.c 87.7 KB