UART - receive buffer
If the data reads have to be generic, for example you are parsing multiple text strings, then indeed you'll have to implement a FIFO ring buffer (which is rather trivial, should be plenty of code for that on the internet).

If the data is not generic, but rather just one single constant sequence, such as a synch word, then you don't need a buffer. Simply read character by character. 

Conceptual pseudo code:

#define LENGTH 4

void read_uart (void)
{
  static const char sync [LENGTH] = "WORD";
  static uint8_t counter = 0;

  char ch;

  uart_err_t error = uart_receive(&amp;ch);

  if(!error &amp;&amp; ch == sync[counter])
  {
    counter++;
  }
  else
  {
    counter=0; // reset

    if(error)
    {
      // handle errors, frame/overrun error etc etc
    }
  }

  if(counter == LENGTH)
  {
    // whole sync word found, everything ok
  }
}