After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 587586 - array subscript is above array bounds
array subscript is above array bounds
Status: RESOLVED FIXED
Product: dasher
Classification: Applications
Component: general
4.10.x
Other All
: Normal normal
: ---
Assigned To: Patrick Welche
dasher-maint
Depends on:
Blocks:
 
 
Reported: 2009-07-02 09:39 UTC by Bin Li
Modified: 2009-07-02 10:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28



Description Bin Li 2009-07-02 09:39:08 UTC
Please describe the problem:
I just tried to build Factory package dasher-4.10.1-1.4
and the build said

CTWLanguageModel.cpp:443:33: warning: array subscript is above array bounds

The source code is

        GenericHeader.szMagic[4] = '\0';

but

dasher-4.10.1/Src/DasherCore/LanguageModelling/LanguageModel.h:    char
szMagic[4];

I agree with the compiler. Suggest code rework.

Steps to reproduce:


Actual results:


Expected results:


Does this happen every time?


Other information:
Comment 1 Patrick Welche 2009-07-02 10:27:14 UTC
It looks as though 4 bytes rather than a NUL-terminated C-string were the intention, so thank you for the report, and it's fixed with

http://git.gnome.org/cgit/dasher/commit/?id=81d2c049304caa4a77845409ca5d0f1403d7abf6