Commit 9aaff94f authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

widl: Check that the buffer has enough space before unmarshalling base types in generated code.

parent 2c6cbea0
......@@ -2611,6 +2611,12 @@ void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase,
}
else if (phase == PHASE_UNMARSHAL)
{
print_file(file, indent, "if (_StubMsg.Buffer + sizeof(");
write_type_decl(file, is_ptr(type) ? type->ref : type, NULL);
fprintf(file, ") > _StubMsg.BufferEnd)\n");
print_file(file, indent, "{\n");
print_file(file, indent + 1, "RpcRaiseException(RPC_X_BAD_STUB_DATA);\n");
print_file(file, indent, "}\n");
if (pass == PASS_IN || pass == PASS_RETURN)
print_file(file, indent, "");
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment