Red Hat Bugzilla – Bug 498182
procps string size issue
Last modified: 2009-05-03 02:46:57 EDT
+++ 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):
fedora has the same problem.
--- Additional comment from firstname.lastname@example.org 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!
fixed in procps-3.2.7-28.fc12
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.