]> code.citadel.org Git - citadel.git/blobdiff - webcit/webserver.c
* client_getln() now fails if the client attempts to transmit non printable
[citadel.git] / webcit / webserver.c
index bebc06417621d7d0a3a1447918a7a086d758053a..c46c79ba301223dd1c01180e4acb278caa3bffd5 100644 (file)
@@ -380,8 +380,13 @@ int client_getln(int sock, char *buf, int bufsiz)
                retval = client_read(sock, &buf[i], 1);
                if (retval != 1 || buf[i] == '\n' || i == (bufsiz-1))
                        break;
+               if ( (!isspace(buf[i])) && (!isprint(buf[i])) ) {
+                       lprintf(2, "Non printable character recieved from client\n");
+                       return(-1);
+               }
        }
 
+
        /** If we got a long line, discard characters until the newline.         */
        if (i == (bufsiz-1))
                while (buf[i] != '\n' && retval == 1)