Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 0ecefa8

Browse files
daghfdridi
authored andcommitted
vmod_h2: VRT_fail if called outside of client context
1 parent cfba263 commit 0ecefa8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/libvmod_h2/vmod_h2.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ h2get(VRT_CTX)
4343
uintptr_t *up;
4444

4545
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
46-
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC); // $Restrict client
46+
if (ctx->req == NULL) {
47+
VRT_fail(ctx,
48+
"vmod_h2 can only be called from client-side VCL.");
49+
return (NULL);
50+
}
51+
CHECK_OBJ_NOTNULL(ctx->req, REQ_MAGIC);
4752
if (ctx->req->transport != &H2_transport)
4853
return (NULL);
4954
AZ(SES_Get_proto_priv(ctx->req->sp, &up));

0 commit comments

Comments
 (0)