• Junio C Hamano's avatar
    Merge branch 'js/regexec-buf' · 6a676952
    Junio C Hamano authored
    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 <ptr,len> 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<pattern> feeds a non NUL-terminated string to regexec() and fails
    6a676952
diffcore-pickaxe.c 6.09 KB