#define SNMP_ERR_WRONGTYPE (0x7)
#define SNMP_ERR_WRONGLENGTH (0x8)
#define SNMP_ERR_WRONGENCODING (0x9)
+/* 0x0A - 0x0F undefined */
#define SNMP_ERR_WRONGVALUE (0x10)
#define SNMP_ERR_NOCREATION (0x11)
#define SNMP_ERR_INCONSISTENTVALUE (0x12)
else
Bin[i / 2] |= n;
}
+/* FIXME: Coverity detects the below as dead code.
+ Why? :: right here i == 32
+ which means the first step of the for loop makes i==16
+ and cannot be < HASHLEN (which is also 16)
+*/
for (i = i / 2; i < HASHLEN; i++) {
Bin[i] = '\0';
}
#include "snmp_error.h"
-static const char *error_string[19] =
-{
+static const char *error_string[25] = {
+ /* 0x00 - 0x05 */
"No Error",
"Response message would have been too large.",
"There is no such variable name in this MIB.",
"This variable is read only",
"A general failure occured",
- /* SNMPv2 Errors */
+ /* 0x06 - 0x09 */
"NOACCESS",
"WRONGTYPE",
"WRONGLENGTH",
"WRONGENCODING",
+
+ /* 0x0A - 0x0F */
+ "UNDEFINED",
+ "UNDEFINED",
+ "UNDEFINED",
+ "UNDEFINED",
+ "UNDEFINED",
+ "UNDEFINED",
+
+ /* 0x10 - 0x18 */
"WRONGVALUE",
"NOCREATION",
"INCONSISTENTVALUE",
AuthBasicUserRequest::authenticated() const
{
BasicUser const *basic_auth = dynamic_cast<BasicUser const *>(user());
- assert (basic_auth != NULL);
- if (basic_auth->authenticated())
+ if (basic_auth && basic_auth->authenticated())
return 1;
return 0;
stuff.S.uri = spec->uri;
stuff.S.version = spec->version;
stuff.S.req_hdrs = spec->req_hdrs;
- hdr.putInt(HDR_AGE,
- e->timestamp <= squid_curtime ?
- squid_curtime - e->timestamp : 0);
+ if(e)
+ hdr.putInt(HDR_AGE, (e->timestamp <= squid_curtime ? (squid_curtime - e->timestamp) : 0) );
+ else
+ hdr.putInt(HDR_AGE, 0);
hdr.packInto(&p);
stuff.D.resp_hdrs = xstrdup(mb.buf);
debugs(31, 3, "htcpTstReply: resp_hdrs = {" << stuff.D.resp_hdrs << "}");
mb.reset();
hdr.reset();
- if (e->expires > -1)
+ if (e && e->expires > -1)
hdr.putTime(HDR_EXPIRES, e->expires);
- if (e->lastmod > -1)
+ if (e && e->lastmod > -1)
hdr.putTime(HDR_LAST_MODIFIED, e->lastmod);
hdr.packInto(&p);