Commit Graph

130 Commits

Author SHA1 Message Date
Robert Shearman 35982d72f5 rpcrt4: Initialise pStubMsg->MemorySize to zero before calling
ComplexStructMemorySize from NdrComplexArrayUnmarshall.
2006-06-12 13:21:46 +02:00
Robert Shearman 539b48bff4 rpcrt4: Use safe_mutiply in conformant array functions. 2006-06-12 13:21:46 +02:00
Robert Shearman 8dea3c2aa8 rpcrt4: Pass in a maximum variance value to ReadVariance to allow us
to validate the conformance values being read from the wire.
2006-06-12 13:21:46 +02:00
Robert Shearman 613ee6d01c rpcrt4: Check that strings are null-terminated on unmarshaling of conformant-varying structs. 2006-06-12 13:21:46 +02:00
Robert Shearman a946eb420b rpcrt4: Use safe_multiply when multiplying anything by pStubMsg->ActualCount or pStubMsg->MaxCount. 2006-06-12 13:21:46 +02:00
Robert Shearman cec6092aa2 rpcrt4: Raise an exception during unmarshaling if a conformant string isn't null-terminated. 2006-06-12 13:21:46 +02:00
Robert Shearman 6e95bfe85a rpcrt4: Introduce a new function, safe_multiply, which will raise an
exception if a multiply overflows a 4-byte integer.

This will protect the unmarshaling code against attacks specifying a 
large variance.
Use this new function in the conformant string functions to harden them 
against attack.
2006-06-12 13:20:30 +02:00
Robert Shearman d98b73a17a rpcrt4: Clear an object pointer during unmarshaling, otherwise we
could end up using the previously allocated memory even if it isn't
the right size, causing heap corruption.
2006-06-09 21:07:57 +02:00
Robert Shearman 578df90d6d rpcrt4: Initialise pStubMsg->MemorySize to zero before calling ComplexStructMemorySize from NdrComplexArrayUnmarshall. 2006-06-09 21:07:44 +02:00
Robert Shearman 21673d03f9 rpcrt4: Implement more base types for complex types. 2006-06-09 21:07:22 +02:00
Robert Shearman c9779ca16b rpcrt4: Implement varying array NDR functions. 2006-06-05 13:25:09 +02:00
Robert Shearman cd19c99284 rpcrt4: Don't call NdrBaseTypeMemorySize from within NdrBaseTypeUnmarshall. 2006-06-05 13:24:54 +02:00
Robert Shearman a48433453b rpcrt4: The lifetime of the binding handle stored in the context
handle is independent of the binding handle used in the call that
unmarshaled it, so we should use RpcBindingCopy to make a copy of it
and then call RpcBindingFree later to free it.
2006-06-03 11:42:25 +02:00
Robert Shearman a4fff73ba3 rpcrt4: Fix an incorrect format string pointer being passed in to
ComputeVariance in NdrConformantVaryingStructBufferSize.
2006-06-03 11:42:13 +02:00
Robert Shearman da44126395 rpcrt4: Align the buffer correctly when marshaling and unmarshaling context handles. 2006-06-03 11:41:51 +02:00
Robert Shearman ec5b3c3ea6 rpcrt4: Freeing a NULL context handle is allowed. 2006-06-03 11:41:42 +02:00
Robert Shearman 1a346a4a13 rpcrt4: NdrClientContextMarshall/Unmarshall should both increment the buffer pointer. 2006-06-03 11:41:33 +02:00
Robert Shearman dc6c640cd2 rpcrt4: Fix the unmarshaling of pointers in conformant varying arrays,
by passing the correct type format string to ReadConformance.
2006-06-03 11:41:22 +02:00
Robert Shearman 972ce2f635 rpcrt4: CContext can be NULL in NDRCContextMarshall, in which case we should marshall all-zeros. 2006-06-03 11:41:07 +02:00
Robert Shearman 678ad6286c rpcrt4: Fix the pointer count used when handling embedded pointers in varying arrays. 2006-06-03 11:40:45 +02:00
Mike McCormack 7f98594f75 rpcrt4: Implement NDRCContext(Un)marshall and NDRCContextBinding. 2006-06-01 11:48:33 +02:00
Huw Davies bb835ae438 rpcrt4: Add ENUM32 support to ComplexStructMemorySize. 2006-05-31 15:48:11 +02:00
Robert Shearman 115525f3c4 rpcrt4: Make UserMarshalFlags static. 2006-05-30 12:25:22 +02:00
Robert Shearman df57b025c6 rpcrt4: We should never pass an fMustAlloc value of TRUE into the
unmarshaler routines of embedded complexes in complex struct and array
unmarshaling.

Fixes a regression caused by commit
19fad8e710, reported by Ulrich
Dobramysl.
2006-05-30 12:25:17 +02:00
Robert Shearman cafd2ab37e rpcrt4: Make sure to set a unique pointer with an id of 0 to NULL when unmarshaling. 2006-05-30 12:25:03 +02:00
Robert Shearman ff9fd9c430 rpcrt4: Handle marshaling/unmarshaling full pointers. 2006-05-30 12:24:41 +02:00
Mike McCormack a534fdec32 rpcrt4: Implement NdrClientContext(Un)Marshall. 2006-05-26 20:21:00 +02:00
Robert Shearman 013d00f094 rpcrt4: Even though FC_DEREFERENCE conformance is handled elsewhere in
ComputeConformanceOrVariance it is still necessary to set the count
variable to the value retrieved.
2006-05-26 20:15:49 +02:00
Mike McCormack 42bf8254c0 rpcrt4: Stub implementations for NDRS marshalling functions. 2006-05-25 10:45:01 +02:00
Robert Shearman ec2a9cef3a rpcrt4: Set the Memory field of the stub message structure to the
start of the memory that an embedded pointer is embedded in so that
FC_POINTER conformance works correctly.
2006-05-25 10:40:35 +02:00
Mike McCormack 4def9cc022 rpcrt4: Add stub implementations for NDRCContext(Un)Marshall. 2006-05-24 14:38:14 +02:00
Huw Davies 69d18c48b1 rpcrt4: Add another static. 2006-05-23 17:51:44 +02:00
Huw Davies 9ba57efc18 rpcrt4: Fix some comments and move the NdrSimpleType* functions out from amongst the NdrSimpleStruct* ones. 2006-05-23 17:51:19 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Robert Shearman 9c885c9185 rpcrt4: We don't need to free object pointers if we are told we must allocate. 2006-05-20 17:37:25 +02:00
Robert Shearman a2767e8d71 rpcrt4: Use macros to generate the code for unmarshaling base types. 2006-05-20 17:37:13 +02:00
Robert Shearman 19fad8e710 rpcrt4: Don't set the memory pointer to NULL before calling PointerUnmarshall.
Call it with fMustAlloc set to TRUE instead to achieve the same result
without side-effects.
2006-05-20 17:36:42 +02:00
Robert Shearman 87ecf526b3 rpcrt4: Make more internal functions static. 2006-05-20 17:36:15 +02:00
Huw Davies f151ecb0d1 rpcrt4: Use IsClient to determine whether we can use the Buffer memory or not.
Add simple struct tests.
2006-05-20 14:03:56 +02:00
Robert Shearman a2d2d4db63 rpcrt4: Update the todo lists and copyrights. 2006-05-20 14:02:24 +02:00
Robert Shearman 855535af62 rpcrt4: Handle interface pointers in EmbeddedComplexSize. 2006-05-18 10:35:16 +02:00
Robert Shearman c1d00c547b rpcrt4: Implement NdrNonEncapsulatedUnionMemorySize. 2006-05-18 10:34:21 +02:00
Robert Shearman 62bbaf70b3 rpcrt4: Fix the wire protocol of the user marshal functions to match MS/RPC. 2006-05-18 10:34:09 +02:00
Robert Shearman 4fae04b2f5 rpcrt4: Fix NdrConformantArrayMemorySize. 2006-05-18 10:33:39 +02:00
Robert Shearman c4fbad1d11 rpcrt4: Implement NdrUserMarshalMemorySize. 2006-05-18 10:33:00 +02:00
Huw Davies effac656bb rpcrt4: Don't update StubMsg->MemorySize while unmarshaling.
Add a bunch of marshaling tests (based on a program by Rob Shearman).
2006-05-17 21:46:43 +02:00
Robert Shearman 45ee17899a rpcrt4: Make some functions that aren't used outside of the file static. 2006-05-17 21:01:02 +02:00
Robert Shearman b52ae402ad rpcrt4: Fill out more of the function tables with functions that already exist. 2006-05-17 21:00:42 +02:00
Robert Shearman ecd3780cc0 rpcrt4: Raise an exception if there is no default handler for a union. 2006-05-17 21:00:35 +02:00
Robert Shearman 0f7e4a877a rpcrt4: Implement fixed array functions. 2006-05-16 12:51:30 +02:00