diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2014-01-06 12:38:11 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2014-01-06 12:38:11 +0000 |
commit | a824b716a5ff1ebf0bb7d51c5f5a79f2e2f2538e (patch) | |
tree | c3b1693e24fcd72a9336820585c4628addde59d5 /usr.bin/cdio | |
parent | 506bee29d548eed6b8b5eaacb93848d4aa2183e4 (diff) |
fgetln may return incomplete lines (Tobias Stoeckmann <tobias@stoeckmann.org>)
simple solution: error out. This is not a correct cddb answer anyways.
Diffstat (limited to 'usr.bin/cdio')
-rw-r--r-- | usr.bin/cdio/cddb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/cdio/cddb.c b/usr.bin/cdio/cddb.c index 722cb8d4cdb..bc3e010aab7 100644 --- a/usr.bin/cdio/cddb.c +++ b/usr.bin/cdio/cddb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cddb.c,v 1.18 2014/01/04 15:39:17 tobias Exp $ */ +/* $OpenBSD: cddb.c,v 1.19 2014/01/06 12:38:10 espie Exp $ */ /* * Copyright (c) 2002 Marc Espie. * @@ -212,6 +212,8 @@ get_line(FILE *cin) line[--len] = 0; if (len != 0 && line[len-1] == '\r') line[--len] = 0; + if (line[len] != 0) + return NULL; return line; } |