Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Gui Ambros

Member Since 15 Aug 2010
Offline Last Active Jul 08 2011 07:12 AM
-----

Posts I've Made

In Topic: Simple multi-threaded web server

10 April 2011 - 10:32 PM

Great stuff Jasper, thanks.

Just a quick bug report: the webserver will crash whenever it receives a request with less than 5 chars due to the string.Substring being used on unchecked data. For example, try telnet <netduino IP> and just hit enter..

Under controlled environments accessed only via a browser this won't be a problem, but if you expose your netduino to the outside world this could be an easy DoS.

I fixed this by changing the initial lines of InterpretRequest to:

            string commandData;

            // Remove GET + Space
            if (rawData.Length > 5)
                commandData = rawData.Substring(5, rawData.Length - 5);
            else
                return null;

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.