• D
    make prefix_path() never return NULL · 62525ef7
    Dmitry Potapov 提交于
    There are 9 places where prefix_path is called, and only in one of
    them the returned pointer was checked to be non-zero and only to
    call exit(128) as it is usually done by die(). In other 8 places,
    the returned value was not checked and it caused SIGSEGV when a
    path outside of the working tree was used. For instance, running
      git update-index --add /some/path/outside
    caused SIGSEGV.
    
    This patch changes prefix_path() to die if the path is outside of
    the repository, so it never returns NULL.
    Signed-off-by: NDmitry Potapov <dpotapov@gmail.com>
    Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
    62525ef7
setup.c 14.0 KB