Skip to contentSkip to conversation

c/r: ipc: uninitialized variable in compat_do_msg_fill()

PATCH New Dan Carpenter 1 participant 1 message Apr 13, 2012 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 c/r: ipc: uninitialized variable in compat_do_msg_fill()

We never initialize "msgp". It's unfortunate that GCC doesn't warn about this.

ipc/compat.c +1 -1
index 6da376b..0c2ebd0 100644
@@ -363,7 +363,7 @@ static long compat_do_msg_steal(void __user *dest, struct msg_msg *msg, size_t b
 
 long compat_do_msg_fill(void __user *dest, struct msg_msg *msg, size_t bufsz)
 {
-	struct compat_msgbuf __user *msgp;
+	struct compat_msgbuf __user *msgp = dest;
 	size_t msgsz;
 
 	if (put_user(msg->m_type, &msgp->mtype))