From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lon Hohberger Date: Tue, 29 Nov 2011 13:01:49 -0500 Subject: [Cluster-devel] [PATCH 36/41] qdiskd: implement better string handling In-Reply-To: References: <1322043360-17037-1-git-send-email-fdinitto@redhat.com> Message-ID: <4ED51E0D.7090206@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote: > Spotted by Coverity Scan > > Signed-off-by: Fabio M. Di Nitto > --- > :100644 100644 e962f74... 477b8de... M cman/qdisk/scandisk.c > cman/qdisk/scandisk.c | 20 +++++++++++++++----- > 1 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/cman/qdisk/scandisk.c b/cman/qdisk/scandisk.c > index e962f74..477b8de 100644 > --- a/cman/qdisk/scandisk.c > +++ b/cman/qdisk/scandisk.c > @@ -311,7 +311,7 @@ static int scanmdstat(struct devlisthead *devlisthead) > if (!fp) > return 0; > > - while (fgets(line, sizeof(line), fp) != NULL) { > + while (fgets(line, sizeof(line) - 1, fp) != NULL) { fgets reads size-1, this isn't needed. -- Lon