Closed Bug 340362 Opened 15 years ago Closed 13 years ago

"ptr" is overwritten in "ptr = malloc" in AffixMgr::parse_affix(char *, char, _IO_FILE *)

Categories

(Core :: Spelling checker, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: timeless, Assigned: mscott)

References

(Blocks 1 open bug, )

Details

(Keywords: coverity, memory-leak)

if this code should never actually reach the switch 3 case twice, then it should be changed so that compilers and compiler like creatures (i.e. coverity and friends) can easily figure that out.
hm is Bug 379847 maybe a dupe of this ? 
Severity: minor → normal
Nemeth, is this still applicable in the Hunspell world?
(In reply to comment #2)
> Nemeth, is this still applicable in the Hunspell world?
> 

I believe, not. I have fixed the coverity related problems reported by Red Hat.
Resolving as FIXED by the landing of Hunspell per comment #3.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Depends on: hunspell
Resolution: --- → FIXED
http://mxr.mozilla.org/seamonkey/search?string=malloc&find=spell

I'm not going to generate bonsai urls this time. 

5052   ccs = (struct cs_info *) malloc(256 * sizeof(cs_info));
5082     ccs[i].cupper = upper[i];

your code is definitely not perfect.

  79 SuggestMgr::SuggestMgr(const char * tryme, int maxn, 
  80                        AffixMgr * aptr)
 108         ckey = pAMgr->get_key_string();
not null
 115   if (ckey) {  
ok
 118         ckeyl = u8_u16(t, MAXSWL, ckey);
 119         ckey_utf = (w_char *) malloc(ckeyl * sizeof(w_char));
fail_alloc()

 140 SuggestMgr::~SuggestMgr()
 145   if (ckey_utf) free(ckey_utf);
safe_check() = ok

 621 int SuggestMgr::badcharkey_utf(char ** wlst, const w_char * word, int wl, int ns, int cpdsuggest)
 622 {
 640     if (!ckey) continue;
check() = ok
 641     w_char * loc = ckey_utf;
 642     while ((loc < (ckey_utf + ckeyl)) && !w_char_eq(*loc, tmpc)) loc++;
array_out_of_bounds() = ~ok

3380                        phone = (phonetable *) malloc(sizeof(struct phonetable));
3381                        phone->num = atoi(piece);
~ok

VERIFIED the bug listed in comment 0 is gone, please use new bugs to fix the rest of the items listed in comment 5.
Status: RESOLVED → VERIFIED
Blocks: 418348
Blocks: 418349
filed bug 418348 and bug 418349
You need to log in before you can comment on or make changes to this bug.