add buffer protect code in dnet_command(), only allow command with len between 1 and DNET_COMMAND_MAX - 1.
@@ -45,6 +45,8 @@ int dnet_command(const char *in, struct dnet_output *out) {
struct dnet_host *host;
FILE *f;
int len;
+
+ if (!(in && in[0]) || (strlen(in) >= DNET_COMMAND_MAX - 1)) return 0;
strcpy(inbuf, in);
cmd = inbuf;
begin:
