diag: Fix Buffer Overflow during HDLC Encoding

Diag driver performs HDLC encoding on the input when an user space
program writes to the Diag node. This fix addresses a potential
buffer overflow during the encoding process.

Change-Id: I6b342027aff924ca7d9afcabda7ba147be9b4411
CRs-Fixed: 416757
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
diag: Add safeguards to prevent Integer Underflow and Memory Leak

At certain areas in the Diag driver, Integer overflow can occur.
Also, there is a possible memory leak in when a user space
program makes a ioctl call. This change fixes these issues.

Change-Id: I37e2b2d1f02983011a1db5f163354af4090f76f0
CRs-Fixed: 416995
CRs-Fixed: 416758
CRs-Fixed: 416953
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
diag: Fix Buffer Overflow in Diag Driver

At certain areas in the Diag driver, there is a possibility of
out of array buffer writes thereby overflowing the buffer.
This change fixes the buffer overflow issues.

Change-Id: I761b0e6cf71ed404b69bb73e88196bc30711b0f0
CRs-Fixed: 416755
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
Merge "diag: Add safeguards to prevent Integer Underflow and Memory Leak"
Merge "diag: Fix Buffer Overflow during HDLC Encoding"
Merge "diag: Fix Buffer Overflow in Diag Driver"