1 // Copyright (2013) Jann Horn <jann@thejh.net>
2 // This code is licensed under the AGPLv3.
8 void check_map_name(void) {
9 if (map == NULL) senderr("missing query string", false);
10 if (strlen(map) > 100) senderr("map string is too long - no stack/heap overlap issue for you!", false);
11 for (char *p = map; *p; p++) {
12 if (*p >= 'a' && *p <= 'z') continue;
13 if (*p >= 'A' && *p <= 'Z') continue;
14 if (*p >= '0' && *p <= '9') continue;
15 if (*p == '_') continue;
16 senderr("bad map name", false);
21 map = getenv("QUERY_STRING");
24 char cmd[4+strlen(map)+1];
25 memcpy(cmd, "map ", 4);
29 puts("Status: 204 changed map"
30 "\nX-Frame-Options: DENY"