mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-06 13:09:50 +00:00
ddb: fix validation of cpu id in 'set db_cpu=x'
MFC after: 1 week
This commit is contained in:
parent
d1755e2845
commit
6e1c5d187c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326567
@ -85,8 +85,8 @@ db_var_db_cpu(struct db_variable *vp, db_expr_t *valuep, int op)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user