diff options
author | Sami Kerola | 2011-07-26 11:49:30 +0200 |
---|---|---|
committer | Karel Zak | 2011-07-26 11:58:38 +0200 |
commit | 739de076503015954ab869812e642c774c2b163e (patch) | |
tree | 712eec26e4b3ce543e394950868b17c32235236d /term-utils/scriptreplay.c | |
parent | whereis: update coding style (diff) | |
download | kernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.tar.gz kernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.tar.xz kernel-qcow2-util-linux-739de076503015954ab869812e642c774c2b163e.zip |
scriptreplay: fix buffer overflow
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'term-utils/scriptreplay.c')
-rw-r--r-- | term-utils/scriptreplay.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/term-utils/scriptreplay.c b/term-utils/scriptreplay.c index 96993d5b8..86c82fde7 100644 --- a/term-utils/scriptreplay.c +++ b/term-utils/scriptreplay.c @@ -203,8 +203,8 @@ main(int argc, char *argv[]) size_t blk; char nl; - if ((fscanf(tfile, "%lf %zd%[\n]\n", &delay, &blk, &nl) != 3) || - (nl != '\n')) { + if (fscanf(tfile, "%lf %zd%c\n", &delay, &blk, &nl) != 3 || + nl != '\n') { if (feof(tfile)) break; if (ferror(tfile)) |