Fix crash caused by parsing 'empty' Florida responses
Crash occures in certain cases when response part '\r\n\r\n' is splitted
into two messages and parser fails to detect the beginning of HTML content
or when returned en mpty seeds list.
@@ -179,6 +179,11 @@ florida_get_seeds(struct context * ctx, struct mbuf *seeds_buf) {
close(sock);
dn_free(remote);
+ if (mbuf_length(seeds_buf) == 0) {
+ log_error("No seeds were found in Florida response (htmlstart %u)", htmlstart);
+ return DN_ERROR;
+ }
+
uint32_t seeds_hash = hash_seeds(seeds_buf->pos, mbuf_length(seeds_buf));
if (last_seeds_hash != seeds_hash) {
