Menu

#45 Dangling pointers in sqlUser/sqlChannel upon db reconection

open
CMaster (8)
5
2011-09-30
2011-09-30
Keith Ward
No

I've discovered a problem in CMaster that will result in a crash in gnuworld due to dangling pointers.

sqlUser and sqlChannel objects are created with a pointer to a dbHandle object.

However when mod.cservice gets disconnected from postgres it runs delete(SQLDb); meaning all cached sqlUser objects and sqlChannel objects now have a dangling pointer and next time the code attempts to use it gnuworld crashes with "pure virtual method called".

Regards,

Discussion

  • Keith Ward

    Keith Ward - 2011-09-30

    I've created a patch for this in my local tree which changes dbHandle* to dbHandle** for sqlUser, sqlBan, sqlLevel and sqlChannel.

    I'll create a diff and upload it once i get home from work tomorrow.

     
  • Keith Ward

    Keith Ward - 2011-09-30

    Fix bug 3415976 - Change dbHandle to dbHandle*

     
  • Keith Ward

    Keith Ward - 2011-09-30

    I've uploaded a patch which should work, but I've not had chance to test it yet - it does compile though.

     

Log in to post a comment.