WRIT: catch silly send size values.
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 9 Jun 2012 12:56:41 +0000 (14:56 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 9 Jun 2012 12:56:41 +0000 (14:56 +0200)
citadel/file_ops.c

index d1b529d57efada1399545722745c3873bdf07e5c..ba4c2c3a9c533817a3843ea38e110ec3dae74656 100644 (file)
@@ -634,6 +634,10 @@ void cmd_writ(char *cmdbuf)
                cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
                return;
        }
+       if (bytes <= 0) {
+               cprintf("%d you have to specify a value > 0.\n", ERROR + ILLEGAL_VALUE);
+               return;
+       }
 
        if (bytes > 100000) {
                bytes = 100000;