Fix segfault with testrig and fifo bad values

pull/1347/head
Mike Black W9MDB 2023-07-19 12:30:21 -05:00
rodzic 2c83486775
commit 64cb40f066
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -37,6 +37,8 @@ int push(FIFO_RIG *fifo, const char *msg)
int peek(FIFO_RIG *fifo)
{
if (fifo->tail < 0 || fifo->head < 0) return -1;
if (fifo->tail > 1023 || fifo->head > 1023) return -1;
if (fifo->tail == fifo->head) { return -1; }
char c = fifo->data[fifo->head];
rig_debug(RIG_DEBUG_VERBOSE, "%s: peek %c (%d,%d)\n", __func__, c, fifo->head,