Re: [PATCH v3 1/4] environment.c: fix potential segfault by get_git_common_dir()

2017-03-19 Thread Duy Nguyen
On Sun, Mar 19, 2017 at 12:54 AM, Junio C Hamano wrote: > Nguyễn Thái Ngọc Duy writes: > >> setup_git_env() must be called before this function to initialize >> git_common_dir so that it returns a non NULL string. And it must return >> a non NULL string or

Re: [PATCH v3 1/4] environment.c: fix potential segfault by get_git_common_dir()

2017-03-18 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > setup_git_env() must be called before this function to initialize > git_common_dir so that it returns a non NULL string. And it must return > a non NULL string or segfault can happen because all callers expect so. > > Normally if somebody has

[PATCH v3 1/4] environment.c: fix potential segfault by get_git_common_dir()

2017-03-18 Thread Nguyễn Thái Ngọc Duy
setup_git_env() must be called before this function to initialize git_common_dir so that it returns a non NULL string. And it must return a non NULL string or segfault can happen because all callers expect so. Normally if somebody has called get_git_dir(), or set_git_dir() then setup_git_env() is