Discussion:
crash if regcomp failed
JiaZhouyang
2017-08-06 14:11:44 UTC
Permalink
Hi,

I'm new to Mutt, I analyzed the source code and found a potential bug that may cause crash.

In mutt-1.8.3/pager.c:1737:4, if "regcomp” failed, "regexec" would cause a crash since "SearchRE" is null.

I think it's unsafe to assume that the library function would be correct. It would be better if we could handle the error properly.

Attached please find the patch against version mutt-1.8.3. Hopefully, it can solve this potential bug.

Best,
Zhouyang
Kevin J. McCarthy
2017-08-06 15:36:27 UTC
Permalink
Post by JiaZhouyang
I'm new to Mutt, I analyzed the source code and found a potential bug that may cause crash.
In mutt-1.8.3/pager.c:1737:4, if "regcomp” failed, "regexec" would cause a crash since "SearchRE" is null.
I think it's unsafe to assume that the library function would be correct. It would be better if we could handle the error properly.
Attached please find the patch against version mutt-1.8.3. Hopefully, it can solve this potential bug.
Thank you for the patch Zhouyang!

In the future, please send patches like this to the mutt-dev mailing
list instead. I will apply and push your patch up later today.

-Kevin
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
Loading...