Bug 498182 - procps string size issue
Summary: procps string size issue
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: procps
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Novotny
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 469495
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-29 10:43 UTC by Daniel Novotny
Modified: 2009-05-03 06:46 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 469495
Environment:
Last Closed: 2009-04-29 10:59:21 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Daniel Novotny 2009-04-29 10:43:19 UTC
+++ This bug was initially created as a clone of Bug #469495 +++

Description of problem:
proc/devname.c has an array that is 4 characters wide that is trying to hold strings that are 5 bytes wide, like "AM12". I will attach a patch fixing this. 

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

Additional Info:
fedora has the same problem.

--- Additional comment from sgrubb on 2008-11-01 10:59:49 EDT ---

Created an attachment (id=322171)
patch fixing problems described herein

This patch widens the strings so they have the NUL terminator. Please apply to RHEL when the opportunity hits and to Fedora at first chance. Thanks!

Comment 1 Daniel Novotny 2009-04-29 10:59:21 UTC
fixed in procps-3.2.7-28.fc12

Comment 2 Albert Cahalan 2009-05-03 06:46:57 UTC
Not a bug.

This is one of the differences between C and C++. The strings are in fact exactly the size requested. Unlike a C++ compiler, a C compiler will respect the programmer's wishes.

The "strings" are of course lacking the typical NUL byte in some cases. This is correctly handled by the code.


Note You need to log in before you can comment on or make changes to this bug.