From cdb7c72699056856ac123d1ba4ab0e8595edbeb9 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Mon, 31 Aug 2009 20:15:04 +1000 Subject: [BUILTIN] Fix NUL termination in readcmd Commit 55c46b7286f5d9f2d8291158203e2b61d2494420 ([BUILTIN] Honor tab as IFS whitespace when splitting fields in readcmd) introduced a bug where sometimes garbage would follow the last field preceding the end-of-line. This was caused by an off-by-one error in the string length calculation. This patch fixes the bug. Signed-off-by: Herbert Xu --- ChangeLog | 4 ++++ src/miscbltin.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9d397e4..13c9010 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-31 Herbert Xu + + * Fix NUL termination in readcmd. + 2009-08-11 Herbert Xu * Pass EV_TESTED into evalcmd. diff --git a/src/miscbltin.c b/src/miscbltin.c index cca0f6c..be746b2 100644 --- a/src/miscbltin.c +++ b/src/miscbltin.c @@ -182,7 +182,7 @@ resetbs: backslash = 0; } STACKSTRNUL(p); - readcmd_handle_line(stackblock(), ap, p - (char *)stackblock()); + readcmd_handle_line(stackblock(), ap, p + 1 - (char *)stackblock()); return status; } -- cgit 1.4.1 /commit/2016/input/day19.txt?id=581e6ab565f53e4b4b715a76d5c2fb8399fc73b5&follow=1'>commit diff homepage
Commit message (Collapse)Author
2017-12-15Day 10, part 2June McEnroe
2017-12-15Day 10June McEnroe
2017-12-14Day 9, part 2June McEnroe
2017-12-14Day 9June McEnroe
I was really sick at the start of the week, okay?
2017-12-09Day 8, part 2June McEnroe
2017-12-09Day 8June McEnroe
2017-12-09Day 7, part 2June McEnroe
I don't even know what this is. Don't look at it.
2017-12-08Day 7June McEnroe
2017-12-06Day 6, part 2June McEnroe
2017-12-06Day 6June McEnroe
2017-12-05Day 5, part 2June McEnroe
2017-12-05Day 5June McEnroe
2017-12-04Day 4, part 2June McEnroe
That ugly sort map though.
2017-12-04Day 4June McEnroe
2017-12-03Day 3, part 2June McEnroe
I am super surprised that worked on the first try.
2017-12-03Day 3, clean upJune McEnroe
2017-12-03Day 3June McEnroe
This is fucking awful and I'm angry.
2017-12-02Day 2, part 2June McEnroe
2017-12-02Day 2June McEnroe
2017-12-01Day 1, part 2June McEnroe
2017-12-01Day 1June McEnroe
2017-11-27Move to 2016 directoryJune McEnroe