+4265. [bug] Address unchecked isc_mem_get calls. [RT #41187]
+
4264. [bug] Check const of strchr/strrchr assignments match
argument's const status. [RT #41150]
mem_tobuffer(isc_buffer_t *target, void *base, unsigned int length) {
isc_region_t tr;
+ if (length == 0U)
+ return (ISC_R_SUCCESS);
+
isc_buffer_availableregion(target, &tr);
if (length > tr.length)
return (ISC_R_NOSPACE);
if (nonce != NULL)
isc_buffer_usedregion(nonce, &r);
else {
- r.base = isc_mem_get(msg->mctx, 0);
+ r.base = NULL;
r.length = 0;
}
tkey.error = 0;
RETERR(buildquery(msg, name, &tkey, ISC_FALSE));
- if (nonce == NULL)
- isc_mem_put(msg->mctx, r.base, 0);
-
RETERR(dns_message_gettemprdata(msg, &rdata));
RETERR(isc_buffer_allocate(msg->mctx, &dynbuf, 1024));
RETERR(dst_key_todns(key, dynbuf));
if (nonce != NULL)
isc_buffer_usedregion(nonce, &r2);
else {
- r2.base = isc_mem_get(rmsg->mctx, 0);
+ r2.base = NULL;
r2.length = 0;
}
RETERR(compute_secret(shared, &r2, &r, &secret));
- if (nonce == NULL)
- isc_mem_put(rmsg->mctx, r2.base, 0);
isc_buffer_usedregion(&secret, &r);
result = dns_tsigkey_create(tkeyname, &rtkey.algorithm,
void
isc_md5_update(isc_md5_t *ctx, const unsigned char *buf, unsigned int len) {
+ if (len == 0U)
+ return;
RUNTIME_CHECK(EVP_DigestUpdate(ctx,
(const void *) buf,
(size_t) len) == 1);