Bug 133610

Summary: nut-2.0.2-3: 2 * array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Michal Marek <mmarek>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: sbrabec
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2005-11-13 16:20:14 UTC
I just tried to compile package nut-2.0.2-3 with a non standard
version of the GNU C compiler.

It said

1.

bestfcom.c:530: warning: array subscript out of range

The source code is

	rstring[sizeof(rstring)] = '\0';

Clearly broken code. Suggest new code

	rstring[ sizeof(rstring) - 1] = '\0';

2.

tripplite.c:147: warning: array subscript out of range

The source code is

        char buf[32];
        buf[32] = '\0';

Clearly broken code. Suggest new code

        buf[31] = '\0';

It would also appear that the mail address of the author [ rkroll@exploits.org ]
seems broken.
Comment 1 Michal Marek 2006-02-20 14:23:08 UTC
Fixed (the secong bug also appeared in the file tripplite_usb.c btw).