ed

simple ed
git clone git://git.2f30.org/ed.git
Log | Files | Refs

commit fec32b46a7e7f226df503b2c25b959ad7b3f59c8
parent b9f37fb33e8f033180758335d8a4c02af9dae075
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Tue Dec  1 18:49:25 +0100

ed: prevent buffer overflow in regex input

Diffstat:
ed.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/ed.c b/ed.c @@ -251,6 +251,8 @@ compile() if (!(pattern = malloc(sizeof(*pattern)))) error("no memory"); } + if (len >= sizeof(buff)) + error("regular expression too long"); memcpy(buff, bp, len); buff[len] = '\0'; if (regcomp(pattern, buff, 0))