From: espie Date: Mon, 6 Jan 2014 12:38:10 +0000 (+0000) Subject: fgetln may return incomplete lines (Tobias Stoeckmann ) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=98f738e74677d451c0c585e1fbcc0f48d86d73f2;p=openbsd fgetln may return incomplete lines (Tobias Stoeckmann ) simple solution: error out. This is not a correct cddb answer anyways. --- 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; }