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: 416749
CRs-Fixed: 416991
CRs-Fixed: 416755
CRs-Fixed: 416745
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
3 files changed