Merge branch 'master' of thejh.net:quakecontrol
[quakecontrol.git] / loadmap.c
index 82b3f6d..d060a34 100644 (file)
--- a/loadmap.c
+++ b/loadmap.c
@@ -1,9 +1,13 @@
+// Copyright (2013) Jann Horn <jann@thejh.net>
+// This code is licensed under the AGPLv3.
+
 #include "common.h"
 
 char *map;
 
 void check_map_name(void) {
   if (map == NULL) senderr("missing query string", false);
 #include "common.h"
 
 char *map;
 
 void check_map_name(void) {
   if (map == NULL) senderr("missing query string", false);
+  if (strlen(map) > 100) senderr("map string is too long - no stack/heap overlap issue for you!", false);
   for (char *p = map; *p; p++) {
     if (*p >= 'a' && *p <= 'z') continue;
     if (*p >= 'A' && *p <= 'Z') continue;
   for (char *p = map; *p; p++) {
     if (*p >= 'a' && *p <= 'z') continue;
     if (*p >= 'A' && *p <= 'Z') continue;
@@ -26,4 +30,4 @@ int main(void) {
      "\nX-Frame-Options: DENY"
      "\n");
   exit(0);
      "\nX-Frame-Options: DENY"
      "\n");
   exit(0);
-}
\ No newline at end of file
+}