Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys/netsmb Pull up following revision(s) (requested by na...
details: https://anonhg.NetBSD.org/src/rev/516bbb884157
branches: netbsd-6
changeset: 774129:516bbb884157
user: riz <riz%NetBSD.org@localhost>
date: Sat May 19 15:25:53 2012 +0000
description:
Pull up following revision(s) (requested by nakayama in ticket #265):
sys/netsmb/subr_mchain.c: revision 1.21
Since "len" has changed to (unsinged) size_t, the while loop
condition (len > 0) became less able to detect its underflow.
So check the subtrahend to avoid the underflow.
Should fix PR kern/44092.
diffstat:
sys/netsmb/subr_mchain.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (36 lines):
diff -r 08181c19864b -r 516bbb884157 sys/netsmb/subr_mchain.c
--- a/sys/netsmb/subr_mchain.c Sat May 19 15:23:39 2012 +0000
+++ b/sys/netsmb/subr_mchain.c Sat May 19 15:25:53 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_mchain.c,v 1.20 2010/12/17 13:05:29 pooka Exp $ */
+/* $NetBSD: subr_mchain.c,v 1.20.14.1 2012/05/19 15:25:53 riz Exp $ */
/*
* Copyright (c) 2000, 2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_mchain.c,v 1.20 2010/12/17 13:05:29 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_mchain.c,v 1.20.14.1 2012/05/19 15:25:53 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,7 +66,7 @@
}
}
mp->m_len = 0;
- len -= M_TRAILINGSPACE(mp);
+ len -= min(len, M_TRAILINGSPACE(mp));
if (m != NULL)
for (mtail = m; mtail->m_next != NULL; mtail = mtail->m_next);
@@ -88,7 +88,7 @@
}
mp->m_len = 0;
- len -= M_TRAILINGSPACE(mp);
+ len -= min(len, M_TRAILINGSPACE(mp));
}
if (mtail != NULL)
Home |
Main Index |
Thread Index |
Old Index