diff options
author | rob <rob@cvs.openbsd.org> | 2018-08-11 04:31:58 +0000 |
---|---|---|
committer | rob <rob@cvs.openbsd.org> | 2018-08-11 04:31:58 +0000 |
commit | 28f2b4b00deed70c80578b3893945b479813c1c0 (patch) | |
tree | 4267785d5ee48ec14b8b4ff56f7d8a97e0f21bdd /usr.sbin | |
parent | 24541c556d3ed4fe1afa33fe58f65e212b41aaf5 (diff) |
Prevent server side overflow for message id in snmp header.
ok sthen@, tb@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/snmpctl/snmpclient.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/snmpctl/snmpclient.c b/usr.sbin/snmpctl/snmpclient.c index 902985d7544..dd0ab231b5d 100644 --- a/usr.sbin/snmpctl/snmpclient.c +++ b/usr.sbin/snmpctl/snmpclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snmpclient.c,v 1.16 2018/08/08 18:50:38 rob Exp $ */ +/* $OpenBSD: snmpclient.c,v 1.17 2018/08/11 04:31:57 rob Exp $ */ /* * Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org> @@ -407,7 +407,7 @@ snmpc_sendreq(struct snmpc *sc, unsigned int type) erroridx = SNMPC_MAXREPETITIONS; /* SNMP header */ - sc->sc_msgid = arc4random(); + sc->sc_msgid = arc4random() & 0x7fffffff; if ((root = ber_add_sequence(NULL)) == NULL) return (-1); if ((b = ber_printf_elements(root, "ds{tddd{{O0}}", |