Re: [PATCH] submodule_init: die cleanly on submodules without url defined

2017-04-25 Thread Stefan Beller
On Mon, Apr 24, 2017 at 5:57 PM, Jeff King wrote: > When we init a submodule, we try to die when it has no URL > defined: > > url = xstrdup(sub->url); > if (!url) > die(...); > > But that's clearly nonsense. xstrdup() will never return > NULL, and if sub->url is NULL, we'll segfault.

[PATCH] submodule_init: die cleanly on submodules without url defined

2017-04-24 Thread Jeff King
When we init a submodule, we try to die when it has no URL defined: url = xstrdup(sub->url); if (!url) die(...); But that's clearly nonsense. xstrdup() will never return NULL, and if sub->url is NULL, we'll segfault. These two bits of code need to be flipped, so we check sub->url b