Skip to contentSkip to conversation

cipso: unsigned buf_len cannot be negative

PATCH Paul Moore 1 participant 1 message Oct 28, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

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

Paul Moore

author Acked-by
#1 lore raw
Quoted 3 lines · you

unsigned buf_len cannot be negative

Hi Roel,

Nice catch, thanks for the patch. Dave, can you apply this patch even though it is in a reply and not the original form? If not let me know and I can re-send Roel's mail if he isn't able.

Quoted 19 lines

---

net/ipv4/cipso_ipv4.c +4 -3
index 490e035..2e78f6b 100644
@@ -2063,9 +2063,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff
 *skb, u32 opt_len;
 	int len_delta;
 
-	buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
-	if (buf_len < 0)
-		return buf_len;
+	ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
+	if (ret_val < 0)
+		return ret_val;
+	buf_len = ret_val;
 	opt_len = (buf_len + 3) & ~3;
 
 	/* we overwrite any existing options to ensure that we have enough
Signature · 2 lines
paul moore
linux @ hp