Bug 56773

Summary: please fix pci.c with this fix
Product: [Retired] Red Hat Raw Hide Reporter: Noel Koethe <noel>
Component: kudzuAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-11-29 12:03:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Noel Koethe 2001-11-27 13:52:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:0.9.5) Gecko/20011023

Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1..
2..
3..
	

Additional info:

--- pci.c.orig  Thu Nov 15 19:30:19 2001
+++ pci.c       Thu Nov 15 19:31:58 2001
@@ -224,7 +224,7 @@
        int x;
        
        x=strchr(searchDev->desc,'|')-searchDev->desc;
-       tmpstr=calloc(x+1,sizeof(char));
+       if(x<=0 || !(tmpstr=calloc(x+1,sizeof(char)))) return NULL;
        tmpstr=strncpy(tmpstr,searchDev->desc,x);
        tmpstr[x] = '\0';
        return tmpstr;

Comment 1 Bill Nottingham 2001-11-28 06:27:13 UTC
Hm, maybe. It implies invalid data in the pcitable, though, and that should be
fixed.

Comment 2 Noel Koethe 2001-11-29 12:03:12 UTC
But kudzu should handle such errors in a better way than to crash.

Comment 3 Bill Nottingham 2002-01-04 03:09:20 UTC
Added in 0.99.41-1 - thanks.