[PATCH] Cygwin: mbrtowi: fix segfault when pwi is NULL

Corinna Vinschen corinna-cygwin@cygwin.com
Wed Apr 19 08:16:27 GMT 2023


On Apr 18 17:05, David McFarland wrote:
> mbrtowi was missing null-checks on pwi, but NULL is passed from
> regex/engine.c:173.
> 
> In a git repo with sendemail.smtpserver set, this results in a segfault when
> using git-send-email, which calls:
> 
> git config --get-regexp '^sende?mail[.]'
> 
> Fixes: 60c25da90d01 ("Cygwin: mbrtowi: define replacement for mbrtowc, returning UTF-32 value")
> Signed-off-by: David McFarland <corngood@gmail.com>
> ---
>  winsup/cygwin/strfuncs.cc | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Good find, thank you!

Pushed.


Thanks,
Corinna


More information about the Cygwin-developers mailing list