bugWeeChat - Bugs: bug #39261, Memory Overwriting

 
 

bug #39261: Memory Overwriting

Submitted by:  None
Submitted on:  Sun Jun 16 16:23:50 2013  
 
Category: pluginsSeverity: 3 - Normal
Item Group: securityStatus: Invalid
Privacy: PublicAssigned to: Sebastien Helleu <flashcode>
Originator Name: Originator Email: -unavailable-
Open/Closed: ClosedRelease: 0.4.1
IRC nick: 

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed Jul 3 08:20:23 2013, comment #1:

I tested, it works fine for me, I have different name as prefix for option in plugins.conf:

Are you sure your two plugins have different name (when using macro WEECHAT_PLUGIN_NAME) ?
(anyway WeeChat should refuse to load two plugins with same name).

Sebastien Helleu <flashcode>
Project AdministratorIn charge of this item.
Sun Jun 16 16:23:50 2013, original submission:

There is a Bug in the code for plugins.

Create two different plugins in C.
PluginA
PluginB

Both plugins at a certain point write to the configuration file plugins.conf.

PluginA:
weechat_config_set_plugin("optiona", "yes");
PluginB:
weechat_config_set_plugin("optionb", "no");

The settings in plugins.conf (or /set plugins.var.*) are:
plugins.var.PluginB.optiona = yes
plugins.var.PluginB.optionb = no

The second plugins loads and overwrites the name of the first!
The first plugin is unable to load its old settings. And it'll read (and write) from (to) the keys of the second plugin too.

If the options had the same name:
/plugin load PluginA
/plugin load PluginB
...sleep(1)...
weechat_config_set_plugin("option", "OK"); /* from PluginA */
weechat_config_set_plugin("option", "WRONG"); /* from PluginB */
the result of /set plugins.var.* is:
plugins.var.PluginB.option = "WRONG"

All options for "PluginA" are lost or overwritten. This may cause crashes if the names of the options of the two plugins are the same.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by flashcode (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Oct 6 07:39:53 2013flashcodeOpen/ClosedOpen=>Closed
    Sat Jul 20 05:56:39 2013flashcodeStatusWorks For Me=>Invalid
    Wed Jul 3 08:20:23 2013flashcodeStatusNone=>Works For Me
      Assigned toNone=>flashcode

    Back to the top


    Powered by Savane 3.1-cleanup