From bd7b9d09e56897b1d03e23080dedf86c7be2bb21 Mon Sep 17 00:00:00 2001 From: keis Date: Sun, 11 Sep 2011 14:32:02 +0200 Subject: bail if trying to send events with newlines each line is treated as a new event by the event manager so previous behaviour could cause to event injection, which in theory could be use to exploit uzbl. --- src/events.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/events.c b/src/events.c index 20f4545..fdb6b2a 100644 --- a/src/events.c +++ b/src/events.c @@ -192,11 +192,15 @@ vsend_event(int type, const gchar *custom_event, va_list vargs) { } } - g_string_append_c(event_message, '\n'); - - if (uzbl.state.events_stdout) - send_event_stdout (event_message); - send_event_socket (event_message); + // A event string is not supposed to contain newlines as it will be + // interpreted as two events + if (!strchr(event_message->str, '\n')) { + g_string_append_c(event_message, '\n'); + + if (uzbl.state.events_stdout) + send_event_stdout (event_message); + send_event_socket (event_message); + } g_string_free (event_message, TRUE); } -- cgit v1.2.3