widl: Prevent NULL pointer de-refs on "void *" types.
This commit is contained in:
parent
d133ff9afb
commit
555cf38269
|
@ -783,16 +783,17 @@ static int encode_type(
|
|||
case VT_PTR:
|
||||
{
|
||||
int next_vt;
|
||||
while((next_vt = get_type_vt(type->ref)) == 0) {
|
||||
if(type->ref == NULL) {
|
||||
next_vt = VT_VOID;
|
||||
for(next_vt = 0; type->ref; type = type->ref) {
|
||||
next_vt = get_type_vt(type->ref);
|
||||
if (next_vt != 0)
|
||||
break;
|
||||
}
|
||||
type = type->ref;
|
||||
}
|
||||
/* if no type found then it must be void */
|
||||
if (next_vt == 0)
|
||||
next_vt = VT_VOID;
|
||||
|
||||
encode_type(typelib, next_vt, type->ref, &target_type, NULL, NULL, &child_size);
|
||||
if(type->ref->type == RPC_FC_IP) {
|
||||
if(type->ref && (type->ref->type == RPC_FC_IP)) {
|
||||
chat("encode_type: skipping ptr\n");
|
||||
*encoded_type = target_type;
|
||||
*width = 4;
|
||||
|
|
Loading…
Reference in New Issue