Bug 151484 - mdbtools-0.5-244: array subscript out of range
Summary: mdbtools-0.5-244: array subscript out of range
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All SuSE Linux 10.1
: P5 - None : Minor
Target Milestone: ---
Assignee: Philipp Thomas
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 13:33 UTC by David Binderman
Modified: 2006-02-16 16:29 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2006-02-16 13:33:29 UTC
I just tried to compile package mdbtools-0.5-244 with a non standard version
of the GNU C compiler.

It said

file.c:102: warning: array subscript out of range

The source code is

        gchar basename[33];
        int i;

        for (i=strlen(file_path);i>=0 && file_path[i]!='/';i--);
        if (file_path[i]=='/') {
                strncpy(basename,&file_path[i+1],32);
        } else {
                strncpy(basename,file_path,32);
        }
        basename[33]='\0';

Clearly broken code. Suggest make array one bigger.
Comment 1 Philipp Thomas 2006-02-16 16:29:06 UTC
Fixed for 10.1 beta4. Thanks for reporting!