Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/x86/x86 more conservative length check.
details: https://anonhg.NetBSD.org/src/rev/d233a7ebf87b
branches: trunk
changeset: 328802:d233a7ebf87b
user: christos <christos%NetBSD.org@localhost>
date: Fri Apr 18 15:00:37 2014 +0000
description:
more conservative length check.
diffstat:
sys/arch/x86/x86/est.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (33 lines):
diff -r b114c1ad1022 -r d233a7ebf87b sys/arch/x86/x86/est.c
--- a/sys/arch/x86/x86/est.c Fri Apr 18 14:32:49 2014 +0000
+++ b/sys/arch/x86/x86/est.c Fri Apr 18 15:00:37 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: est.c,v 1.29 2014/03/27 18:22:56 christos Exp $ */
+/* $NetBSD: est.c,v 1.30 2014/04/18 15:00:37 christos Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -76,7 +76,7 @@
* http://www.codemonkey.org.uk/projects/cpufreq/cpufreq-2.4.22-pre6-1.gz
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.29 2014/03/27 18:22:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: est.c,v 1.30 2014/04/18 15:00:37 christos Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -1272,12 +1272,11 @@
return false;
for (i = len = 0; i < sc->sc_fqlist->n; i++) {
-
+ if (len >= sc->sc_freqs_len)
+ break;
len += snprintf(sc->sc_freqs + len, sc->sc_freqs_len - len,
"%d%s", MSR2MHZ(sc->sc_fqlist->table[i], sc->sc_bus_clock),
i < sc->sc_fqlist->n - 1 ? " " : "");
- if (len > sc->sc_freqs_len)
- break;
}
aprint_debug_dev(self, "%d mV, %d (MHz): %s\n", mv,
Home |
Main Index |
Thread Index |
Old Index