changeset 1840:5f574f78eff6

Limit search block max size.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 31 Oct 2017 20:50:02 +0200
parents 0402237b734e
children f8a154acd29c
files mapsearch.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mapsearch.c	Tue Oct 31 19:43:44 2017 +0200
+++ b/mapsearch.c	Tue Oct 31 20:50:02 2017 +0200
@@ -734,6 +734,13 @@
         goto out;
     }
 
+
+    if (width * height > 400)
+    {
+        *verr = "Search block pattern too large.";
+        goto out;
+    }
+
     if ((pattern = mapBlockAlloc(width, height)) == NULL)
         goto out;