FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 11-29-2011, 05:01 PM
Lon Hohberger
 
Default qdiskd: implement better string handling

On 11/23/2011 05:15 AM, Fabio M. Di Nitto wrote:

Spotted by Coverity Scan

Signed-off-by: Fabio M. Di Nitto<fdinitto@redhat.com>
---
: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
 

Thread Tools




All times are GMT. The time now is 06:32 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org