Merge "diag: Fix Buffer Overflow during HDLC Encoding"