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

This commit is contained in:
Rob Shearman 2007-12-30 16:45:05 +00:00 committed by Alexandre Julliard
parent 2c6cbea080
commit 9aaff94fb7
1 changed files with 6 additions and 0 deletions

View File

@ -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