From d6b80ad910302c23399335dd83a2e1bd947196fc Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 14 Sep 2016 23:02:11 +0530 Subject: [PATCH 1/2] ChangeLog entry for #12473 Signed-off-by: Deven Bansod --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 2c36696489..5f3ae63570 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ phpMyAdmin - ChangeLog - issue #11924 Remove caching of server information - issue #11628 Proper parsing of INSERT ... ON DUPLICATE KEY queries - issue #12545 Proper parsing of CREATE TABLE ... PARTITION queries +- issue #12473 Code can throw unhandled exception 4.6.4 (2016-08-16) - issue [security] Weaknesses with cookie encryption, see PMASA-2016-29 From 10e4f0a3ddcf7d8d540322b8a0fbc07a01171bbb Mon Sep 17 00:00:00 2001 From: Deven Bansod Date: Wed, 14 Sep 2016 23:06:25 +0530 Subject: [PATCH 2/2] Check if the regex matching returns null before using it further Fix #12473 : Code can throw unhandled exception Signed-off-by: Deven Bansod --- js/functions.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/functions.js b/js/functions.js index 103ba84707..99eff84673 100644 --- a/js/functions.js +++ b/js/functions.js @@ -613,8 +613,12 @@ function confirmLink(theLink, theSqlQuery) if (is_confirmed) { if ($(theLink).hasClass('formLinkSubmit')) { var name = 'is_js_confirmed'; + if ($(theLink).attr('href').indexOf('usesubform') != -1) { - name = 'subform[' + $(theLink).attr('href').substr('#').match(/usesubform\[(\d+)\]/i)[1] + '][is_js_confirmed]'; + var matches = $(theLink).attr('href').substr('#').match(/usesubform\[(\d+)\]/i); + if (matches != null) { + name = 'subform[' + matches[1] + '][is_js_confirmed]'; + } } $(theLink).parents('form').append('');