summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorNei <ailin.nemui@gmail.com>2018-01-04 22:19:34 +0000
committerNei <ailin.nemui@gmail.com>2018-01-04 22:19:34 +0000
commitf5c3995feaf70b06225f6af4a126ba33adcd4f6c (patch)
treeea63803f24e003a22960312cfa6959194520cabe /src/core
parent94f0cbe34a2089d00ba1bf61e9c2b28318f953b9 (diff)
parent7a83c63701b7395ee6cc606905314318eef77971 (diff)
downloadirssi-f5c3995feaf70b06225f6af4a126ba33adcd4f6c.zip
Merge branch 'fix-gl-21' into 'security'
check if \\c is complete in eval See merge request irssi/irssi!26
Diffstat (limited to 'src/core')
-rw-r--r--src/core/misc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/misc.c b/src/core/misc.c
index e589b8c5..4e9f4bbe 100644
--- a/src/core/misc.c
+++ b/src/core/misc.c
@@ -703,8 +703,11 @@ int expand_escape(const char **data)
*data += 2;
return strtol(digit, NULL, 16);
case 'c':
- /* control character (\cA = ^A) */
- (*data)++;
+ /* check for end of string */
+ if ((*data)[1] == '\0')
+ return 0;
+ /* control character (\cA = ^A) */
+ (*data)++;
return i_toupper(**data) - 64;
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':