c
< 	gsm->buf[gsm->count++] = c;
---
> 	if (gsm->count < gsm->mru) {
> 		gsm->buf[gsm->count++] = c;
> 	} else {
> 		// Handle error: out-of-bounds access
> 	}
