Building a Tiny CLI Shell for Tiny Firmware | Interrupt

I really enjoyed the tutorial and the code. I believe I found a bug in shell_receive_char:

  if (c == '\b') {
    s_shell.rx_buffer[--s_shell.rx_size] = '\0';
    return;
  }

There are no checks for underflow here. When it does underflow, it will corrupt one byte somewhere in memory. After that, the buffer will appear full and will not accept any more characters, locking up the shell indefinitely.