SSL_get0_next_proto_negotiated(
inctx->ssl, &next_proto, &next_proto_len);
ap_log_cerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, f->c,
- "SSL NPN negotiated protocol: '%s'",
- apr_pstrmemdup(f->c->pool, (const char*)next_proto,
- next_proto_len));
+ APLOGNO(02306) "SSL NPN negotiated protocol: '%*s'",
+ next_proto_len, (const char*)next_proto);
modssl_run_npn_proto_negotiated_hook(
f->c, (const char*)next_proto, next_proto_len);
inctx->npn_finished = 1;
/* If the protocol name is too long (the length must fit in one byte),
* then log an error and skip it. */
if (length > 255) {
- ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c,
+ ap_log_cerror(APLOG_MARK, APLOG_ERR, 0, c, APLOGNO(02307)
"SSL NPN protocol name too long (length=%u): %s",
length, string);
continue;
for (i = 0; i < num_protos; ++i) {
const char *string = APR_ARRAY_IDX(protos, i, const char*);
apr_size_t length = strlen(string);
+ if (length > 255)
+ continue;
*start = (unsigned char)length;
++start;
memcpy(start, string, length * sizeof(unsigned char));