Check first for the unlikely case of an empty needle string and only
then populate the filespec, lest we leak it.
Signed-off-by: Rene Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
unsigned int cnt;
unsigned long sz;
const char *data;
- if (diff_populate_filespec(one, 0))
- return 0;
if (!len)
return 0;
+ if (diff_populate_filespec(one, 0))
+ return 0;
sz = one->size;
data = one->data;