Skip to contentSkip to conversation

linux: Fix xenbus device write function.

Xen-changelog John Levon 2 participants 2 messages Mar 7, 2007 – Mar 8, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

John Levon

author
#1 lore raw

Review

Quoted 6 lines · Keir Fraser
(quoted diff) +3 -2
 	u->len += len;
-	if (u->len < (sizeof(u->u.msg) + u->u.msg.len))
-		return len;
+	if ((u->len < sizeof(u->u.msg)) ||
+	    (u->len < (sizeof(u->u.msg) + u->u.msg.len)))
+		return rc;

What is this trying to achieve?

regards
john

#2 lore raw
Quoted 8 lines · John Levon

Review

Quoted 6 lines

u->len += len;
- if (u->len < (sizeof(u->u.msg) + u->u.msg.len))

(quoted diff) +3 -1
-  return len;
+ if ((u->len < sizeof(u->u.msg)) ||
+     (u->len < (sizeof(u->u.msg) + u->u.msg.len)))
+  return rc;

What is this trying to achieve?

Check you have a complete header before comparing on the header's length field.

-- Keir