bugWeeChat - Bugs: bug #39261, Memory Overwriting

 
 

bug #39261: Memory Overwriting

Submitter:  None
Submitted:  Sun 16 Jun 2013 04:23:50 PM UTC
   
 
Category:  plugins Severity:  3 - Normal
Item Group:  security Status:  Invalid
Privacy:  Public Assigned to:  flashcode
Originator Name:  Originator Email:  * -email is unavailable-
Open/Closed:  Closed Release:  * 0.4.1
IRC nick: 
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 03 Jul 2013 08:20:23 AM UTC, comment #1: 

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


plugina.optiona = "yes"
pluginb.optionb = "no"


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>
Group administrator
Sun 16 Jun 2013 04:23:50 PM UTC, 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-10-06 flashcode Open/ClosedOpen Closed
    2013-07-20 flashcode StatusWorks For Me Invalid
    2013-07-03 flashcode StatusNone Works For Me
        Assigned toNone flashcode

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code