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

Alexandre Julliard julliard at winehq.org
Mon Dec 31 12:32:24 CST 2007


Module: wine
Branch: master
Commit: 9aaff94fb7c49ec48f909b86dc219b81913afce8
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9aaff94fb7c49ec48f909b86dc219b81913afce8

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sun Dec 30 16:45:05 2007 +0000

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

---

 tools/widl/typegen.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index dee5ad8..f40399f 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -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




More information about the wine-cvs mailing list