From: Junio C Hamano Date: Thu, 29 Sep 2016 23:49:44 +0000 (-0700) Subject: Merge branch 'js/regexec-buf' into maint X-Git-Tag: v2.10.1~9 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/300e95f7df240a0f6efea09d5e21fcc350e5ce83 Merge branch 'js/regexec-buf' into maint Some codepaths in "git diff" used regexec(3) on a buffer that was mmap(2)ed, which may not have a terminating NUL, leading to a read beyond the end of the mapped region. This was fixed by introducing a regexec_buf() helper that takes a pair with REG_STARTEND extension. * js/regexec-buf: regex: use regexec_buf() regex: add regexec_buf() that can work on a non NUL-terminated string regex: -G feeds a non NUL-terminated string to regexec() and fails --- 300e95f7df240a0f6efea09d5e21fcc350e5ce83 diff --cc Makefile index 7f184923dd,c6dc42d067..7a36af8665 --- a/Makefile +++ b/Makefile @@@ -296,12 -296,8 +296,13 @@@ all: # Define USE_NED_ALLOCATOR if you want to replace the platforms default # memory allocators with the nedmalloc allocator written by Niall Douglas. # +# Define OVERRIDE_STRDUP to override the libc version of strdup(3). +# This is necessary when using a custom allocator in order to avoid +# crashes due to allocation and free working on different 'heaps'. +# It's defined automatically if USE_NED_ALLOCATOR is set. +# - # Define NO_REGEX if you have no or inferior regex support in your C library. + # Define NO_REGEX if your C library lacks regex support with REG_STARTEND + # feature. # # Define HAVE_DEV_TTY if your system can open /dev/tty to interact with the # user.