[DBMail 0001041]: [sortsieve.c:370]: (style) Array index 'j' is used before limits check.

Mantis Bug Tracker <[email protected]>
Newsgroups gmane.mail.imap.dbmail.devel
Message-ID <[email protected]>
The following issue has been SUBMITTED. 
====================================================================== 
http://www.dbmail.org/mantis/view.php?id=1041 
====================================================================== 
Reported By:                dcb314
Assigned To:                
====================================================================== 
Project:                    DBMail
Issue ID:                   1041
Category:                   General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
target:                      
====================================================================== 
Date Submitted:             04-Feb-14 22:29 CET
Last Modified:              04-Feb-14 22:29 CET
====================================================================== 
Summary:                    [sortsieve.c:370]: (style) Array index 'j' is used
before limits check.
Description: 
I just ran the static analyser cppcheck over
the source code of dbmail-3.0.2

It said many things, including

[sortsieve.c:370]: (style) Array index 'j' is used before limits check.

Source code is

            for (j = 0; imap_flag_desc[j] && j < IMAP_NFLAGS; j++) {

Suggest make j sanity check before use. I also checked
the most recent code in git and the problem exists there also.


====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
04-Feb-14 22:29  dcb314         New Issue                                    
======================================================================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.