From 7d15e91e26c8d79b2771a5ed9a30512a4f372aa1 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 4 Nov 2014 16:57:34 +0800 Subject: [PATCH] vpi/ipc: fix decoding of index buffer --- vpi/ipc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vpi/ipc.c b/vpi/ipc.c index d41920c76..ee1920e5e 100644 --- a/vpi/ipc.c +++ b/vpi/ipc.c @@ -76,7 +76,7 @@ enum { */ int ipc_receive(struct ipc_softc *sc) { - char buffer[MAX_LEN]; + unsigned char buffer[MAX_LEN]; ssize_t l; int i; @@ -97,7 +97,7 @@ int ipc_receive(struct ipc_softc *sc) unsigned char *chunks; unsigned int index; - name = &buffer[i]; + name = (char *)&buffer[i]; i += strlen(name) + 1; assert((i+4) < l); index = buffer[i] | buffer[i+1] << 8 | buffer[i+2] << 16 | buffer[i+3] << 24; @@ -112,7 +112,7 @@ int ipc_receive(struct ipc_softc *sc) char *name; unsigned int index; - name = &buffer[i]; + name = (char *)&buffer[i]; i += strlen(name) + 1; assert((i+4) == l); index = buffer[i] | buffer[i+1] << 8 | buffer[i+2] << 16 | buffer[i+3] << 24;