Bug 152039

Summary: pam_smb-2.0.0rc6-7: 3 * array subscript out of range
Product: [openSUSE] SUSE LINUX 10.0 Reporter: David Binderman <dcb314>
Component: BasesystemAssignee: Petr Ostadal <postadal>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2006-02-18 12:28:36 UTC
I just tried to compile package pam_smb-2.0.0rc6-7 with the Intel C compiler.

It said

1.

pam_read_conf.c(59): warning #175: subscript out of range

The source code is

	pamsmb_dlist->controllers[0].domain[MAX_SERV_LEN]='\0';

but 

linux:/usr/src/packages/SPECS # find ../BUILD/pam_smb-2.0.0-rc6/ -name \*.h -print | xargs fgrep "domain["
../BUILD/pam_smb-2.0.0-rc6/include/cache.h:  char domain[MAX_NTDOM_LEN];
../BUILD/pam_smb-2.0.0-rc6/include/pam_smb_queue.h:  char domain[MAX_NTDOM_LEN];

and

linux:/usr/src/packages/SPECS # find ../BUILD/pam_smb-2.0.0-rc6/ -name \*.h -print | xargs grep "define.*MAX_NTDOM_LEN"
../BUILD/pam_smb-2.0.0-rc6/include/constants.h:#define MAX_NTDOM_LEN 32

linux:/usr/src/packages/SPECS # find ../BUILD/pam_smb-2.0.0-rc6/ -name \*.h -print | xargs grep "define.*MAX_SERV_LEN"
../BUILD/pam_smb-2.0.0-rc6/include/constants.h:#define MAX_SERV_LEN 64

So we can see that the program is trying to index 64 into an array of size 32.

Suggest code rework.

2.

pam_read_conf.c(64): warning #175: subscript out of range
pam_read_conf.c(69): warning #175: subscript out of range

Duplicates.
Comment 1 Petr Ostadal 2006-02-20 14:56:58 UTC
fixed and submited to STABLE