Re: [PATCH] mailinfo: avoid segfault when can't open files

2018-01-24 Thread Jeff King
On Wed, Jan 24, 2018 at 01:51:31PM -0300, Juan F. Codagnone wrote: > > As for the patch itself, it looks correct but I saw two style nits: > > Thanks for the detailed review! I'm sorry about the style nits. I > focused on the tabs and braces. Next time I will take additional > attention. No prob

Re: [PATCH] mailinfo: avoid segfault when can't open files

2018-01-24 Thread Juan F. Codagnone
On Wed, Jan 24, 2018 at 1:02 AM, Jeff King wrote: > > On Tue, Jan 23, 2018 at 11:54:17PM -0300, Juan F. Codagnone wrote: ... > > > But given the lack of callers, it may not be worth the effort. So I'm OK > with this solution. It may be worth giving an abbreviated version of the > above explanation

Re: [PATCH] mailinfo: avoid segfault when can't open files

2018-01-23 Thread Jeff King
On Tue, Jan 23, 2018 at 11:54:17PM -0300, Juan F. Codagnone wrote: > If or files can't be opened, clear_mailinfo crash as > it follows NULL pointers. > > Can be reproduced using `git mailinfo . .` Thanks for finding this. Looking at the offending code and your solution, it looks like: 1. m

[PATCH] mailinfo: avoid segfault when can't open files

2018-01-23 Thread Juan F. Codagnone
If or files can't be opened, clear_mailinfo crash as it follows NULL pointers. Can be reproduced using `git mailinfo . .` Signed-off-by: Juan F. Codagnone --- mailinfo.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mailinfo.c b/mailinfo.c index a89db22ab..035