ref: c14ea9fdd1521ff9322f9af71b801e016622c0cd
parent: af6f03e52829a571f1fa3d61c0bfa09a1c89ea36
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Mar 12 07:29:15 EST 2022
awk: fix off-by-one string buffer overflow from gsub the bug happens when we did the fast exit thru "done" label, where we would not make sure that theres space in the buffer for the NUL terminator. instead, avoid the fast exit and always do the final adjbuf() that makes sure we have space for the NUL terminator. remove the pointless pb checks, they'r wrong (should'v been bp >= buf+bufsz) and adjbuf() already makes sure this can never happen.