#27 Improper allocation in hashmgr.cxx

closed-fixed
None
5
2010-03-04
2009-08-25
No

From Chromium (known as Google Chrome) Coverity warning states:

335 // remove word (personal dictionary function for standalone applications)
336 int HashMgr::remove(const char * word)
337 {
338 struct hentry * dp = lookup(word);
339 while (dp) {
340 if (dp->alen == 0 || !TESTAFF(dp->astr, forbiddenword,
dp->alen)) {
Event incorrect_multiplication: Allocating multiple of 4 bytes to
pointer "flags", which needs 2 bytes
Event buffer_alloc: Called allocating function "malloc(4U * (dp->alen + 1))"
341 unsigned short * flags =
342 (unsigned short *) malloc(sizeof(short *) *
(dp->alen + 1));

Discussion

  • Mohamed Mansour

    Mohamed Mansour - 2009-08-25
    • summary: Coverity Warning - Improper allocation --> Coverity Warning - Improper allocation in hashmgr.cxx
     
  • Mohamed Mansour

    Mohamed Mansour - 2009-08-25
    • summary: Coverity Warning - Improper allocation in hashmgr.cxx --> Improper allocation in hashmgr.cxx
     
  • Mohamed Mansour

    Mohamed Mansour - 2009-08-25
    • assigned_to: nobody --> nemethl
     
  • caolan mcnamara

    caolan mcnamara - 2010-02-23

    fix checked in

     
  • caolan mcnamara

    caolan mcnamara - 2010-03-04
    • status: open --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks