Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Dec 2017 14:22:08 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326567 - head/sys/ddb
Message-ID:  <201712051422.vB5EM8MH035276@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Dec  5 14:22:08 2017
New Revision: 326567
URL: https://svnweb.freebsd.org/changeset/base/326567

Log:
  ddb: fix validation of cpu id in 'set db_cpu=x'
  
  MFC after:	1 week

Modified:
  head/sys/ddb/db_sym.c

Modified: head/sys/ddb/db_sym.c
==============================================================================
--- head/sys/ddb/db_sym.c	Tue Dec  5 13:41:21 2017	(r326566)
+++ head/sys/ddb/db_sym.c	Tue Dec  5 14:22:08 2017	(r326567)
@@ -85,8 +85,8 @@ db_var_db_cpu(struct db_variable *vp, db_expr_t *value
 		return (1);
 
 	case DB_VAR_SET:
-		if (*(int *)valuep < -1 && *(int *)valuep > mp_maxid) {
-			db_printf("Invalid value: %d", *(int*)valuep);
+		if (*(int *)valuep < -1 || *(int *)valuep > mp_maxid) {
+			db_printf("Invalid value: %d\n", *(int*)valuep);
 			return (0);
 		}
 		db_cpu = *(int *)valuep;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712051422.vB5EM8MH035276>