x86/oprof: adjust off-by-one counter range checks

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 26061:4b4c0c7a6031
xen-unstable date: Wed Oct 17 09:23:10 UTC 2012
This commit is contained in:
Jan Beulich committed 2012-10-29 09:02:33 +01:00
1 parent 08a5c2cf7d
commit 42f8e580bc
1 file changed
+2 -2
+2 -2
View File
@@ -25,7 +25,7 @@ int xenoprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
if ( copy_from_guest(&counter, arg, 1) )
return -EFAULT;
if ( counter.ind > OP_MAX_COUNTER )
if ( counter.ind >= OP_MAX_COUNTER )
return -E2BIG;
counter_config[counter.ind].count = counter.count;
@@ -63,7 +63,7 @@ int compat_oprof_arch_counter(XEN_GUEST_HANDLE(void) arg)
if ( copy_from_guest(&counter, arg, 1) )
return -EFAULT;
if ( counter.ind > OP_MAX_COUNTER )
if ( counter.ind >= OP_MAX_COUNTER )
return -E2BIG;
counter_config[counter.ind].count = counter.count;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.