diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-31 22:32:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-31 22:32:14 +0000 |
commit | 30e6825e1b0a1ab782552572381a4755cd33e9fd (patch) | |
tree | ba58872a4aecb53d7f04438c5126f947fbc2ee2f /class.c | |
parent | 1611735b293128f8638f68b21d66e34817eb8f86 (diff) | |
download | ruby-30e6825e1b0a1ab782552572381a4755cd33e9fd.tar.gz |
tkutil.c: fix memory leak and segfault
* ext/tk/tkutil/tkutil.c (cbsubst_append_inf_key): extract a
function append a key in subst info to a string. make result
strings first and get rid of potential memory leak.
* ext/tk/tkutil/tkutil.c (cbsubst_get_subst_arg): allocate the
result buffer as a string to fix:
* memory leak when the argument key is not found:
loop {Tk::Event.subst_arg(:a) rescue nil}
* buffer overflow segfault when many arguments:
class T < TkUtil::CallbackSubst
_setup_subst_table([[?a, ?A, :_a]], [])
subst_arg(*[:_a]*1000).size
end
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
0 files changed, 0 insertions, 0 deletions