From 75a12a94614e09806efd0366c75fabae049a7926 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 1 Sep 2017 13:40:12 -0400 Subject: [PATCH] check for matching '/' in screen edid before fuzzy matching in randr init if no / exists then this function is pointless --- src/bin/e_randr2.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bin/e_randr2.c b/src/bin/e_randr2.c index 1fd3d1bc1..c480cfd08 100644 --- a/src/bin/e_randr2.c +++ b/src/bin/e_randr2.c @@ -739,9 +739,11 @@ _screen_fuzzy_fallback_find(E_Config_Randr2 *cfg, const char *id) // strip out everythng in the string from / on as that is edid // and fall back to finding just the output name in the rel // to identifier, rather than the specific screen id - name = alloca(strlen(id) + 1); - strcpy(name, id); - if ((p = strchr(name, '/'))) *p = 0; + p = strchr(id, '/'); + if (!p) return NULL; + name = alloca((p - id) + 1); + strncpy(name, id, p - id); + name[p - id] = 0; s = _screen_id_find(id); if (!s) s = _screen_output_find(name);