Skip to content

Commit

Permalink
cache_http2_hpack: Improve usefulnes of field value check
Browse files Browse the repository at this point in the history
  • Loading branch information
nigoroll committed Feb 23, 2025
1 parent d0fe497 commit bd0076f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bin/varnishd/http2/cache_http2_hpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,17 @@ h2h_checkhdr(struct vsl_log *vsl, txt nm, txt val)
case FLD_VALUE_FIRST:
if (vct_issp(*p)) {
VSLb(vsl, SLT_BogoHeader,
"Illegal field value start %.*s", l, nm.b);
"Illegal field value 0x%02x start %.*s",
*p, l, nm.b);
return (H2SE_PROTOCOL_ERROR);
}
state = FLD_VALUE;
/* FALLTHROUGH */
case FLD_VALUE:
if (!vct_ishdrval(*p)) {
VSLb(vsl, SLT_BogoHeader,
"Illegal field value %.*s", l, nm.b);
"Illegal field value 0x%02x %.*s",
*p, l, nm.b);
return (H2SE_PROTOCOL_ERROR);
}
break;
Expand All @@ -124,7 +126,8 @@ h2h_checkhdr(struct vsl_log *vsl, txt nm, txt val)
}
if (state == FLD_VALUE && vct_issp(val.e[-1])) {
VSLb(vsl, SLT_BogoHeader,
"Illegal field value (end) %.*s", l, nm.b);
"Illegal field value 0x%02x (end) at %.*s",
val.e[-1], l, nm.b);
return (H2SE_PROTOCOL_ERROR);
}
return (0);
Expand Down

0 comments on commit bd0076f

Please sign in to comment.