Browse Source

Check return value of stratum_parse.

Con Kolivas 13 years ago
parent
commit
31c3759ecd
1 changed files with 6 additions and 1 deletions
  1. 6 1
      util.c

+ 6 - 1
util.c

@@ -1116,7 +1116,12 @@ bool auth_stratum(struct pool *pool)
 	/* Parse all data prior sending auth request */
 	while (sock_full(pool->sock, false)) {
 		sret = recv_line(pool->sock);
-		parse_stratum(pool, sret);
+		if (!parse_stratum(pool, sret)) {
+			clear_sock(pool->sock);
+			applog(LOG_WARNING, "Failed to parse stratum buffer");
+			free(sret);
+			return ret;
+		}
 		free(sret);
 	}