diff --git a/src/liblsquic/lsquic_di_hash.c b/src/liblsquic/lsquic_di_hash.c index 1d56202..90448c5 100644 --- a/src/liblsquic/lsquic_di_hash.c +++ b/src/liblsquic/lsquic_di_hash.c @@ -278,6 +278,7 @@ block_write (struct data_block *block, unsigned block_off, unsigned set, bit, n_full_sets, n; uint64_t mask; + assert(block_off < DB_DATA_SIZE); if (data_sz > DB_DATA_SIZE - block_off) data_sz = DB_DATA_SIZE - block_off; diff --git a/src/liblsquic/lsquic_full_conn.c b/src/liblsquic/lsquic_full_conn.c index d2bbc62..aca9467 100644 --- a/src/liblsquic/lsquic_full_conn.c +++ b/src/liblsquic/lsquic_full_conn.c @@ -2496,6 +2496,8 @@ create_delayed_streams (struct full_conn *conn) avail = conn->fc_cfg.max_streams_out - stream_count; if (conn->fc_n_delayed_streams < avail) avail = conn->fc_n_delayed_streams; + if (avail == 0) + return; new_streams = malloc(sizeof(new_streams[0]) * avail); if (!new_streams) diff --git a/src/liblsquic/lsquic_spi.c b/src/liblsquic/lsquic_spi.c index 8d7e861..dd1dd3f 100644 --- a/src/liblsquic/lsquic_spi.c +++ b/src/liblsquic/lsquic_spi.c @@ -161,7 +161,7 @@ find_and_set_next_priority (struct stream_prio_iter *iter) if (iter->spi_set[ set ]) break; - if (set == 4) + if (set >= 4) { //SPI_DEBUG("%s: cannot find any", __func__); return -1;