Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
fa2b886d
Commit
fa2b886d
authored
Jun 14, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Also check array pointers for null ref pointers.
parent
c70ef629
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
25 deletions
+6
-25
client.c
tools/widl/client.c
+2
-11
proxy.c
tools/widl/proxy.c
+4
-13
widltypes.h
tools/widl/widltypes.h
+0
-1
No files found.
tools/widl/client.c
View file @
fa2b886d
...
...
@@ -59,17 +59,8 @@ static void check_pointers(const var_t *func)
return
;
LIST_FOR_EACH_ENTRY
(
var
,
type_get_function_args
(
func
->
type
),
const
var_t
,
entry
)
{
if
(
is_var_ptr
(
var
)
&&
cant_be_null
(
var
))
{
print_client
(
"if (!%s)
\n
"
,
var
->
name
);
print_client
(
"{
\n
"
);
indent
++
;
print_client
(
"RpcRaiseException(RPC_X_NULL_REF_POINTER);
\n
"
);
indent
--
;
print_client
(
"}
\n\n
"
);
}
}
if
(
cant_be_null
(
var
))
print_client
(
"if (!%s) RpcRaiseException(RPC_X_NULL_REF_POINTER);
\n
"
,
var
->
name
);
}
static
void
write_client_func_decl
(
const
type_t
*
iface
,
const
var_t
*
func
)
...
...
tools/widl/proxy.c
View file @
fa2b886d
...
...
@@ -120,16 +120,13 @@ static void clear_output_vars( const var_list_t *args )
}
}
int
is_var_ptr
(
const
var_t
*
v
)
{
return
is_ptr
(
v
->
type
);
}
int
cant_be_null
(
const
var_t
*
v
)
{
switch
(
typegen_detect_type
(
v
->
type
,
v
->
attrs
,
TDT_IGNORE_STRINGS
))
{
case
TGT_ARRAY
:
if
(
!
type_array_is_decl_as_ptr
(
v
->
type
))
return
0
;
/* fall through */
case
TGT_POINTER
:
return
(
get_pointer_fc
(
v
->
type
,
v
->
attrs
,
TRUE
)
==
RPC_FC_RP
);
case
TGT_CTXT_HANDLE_POINTER
:
...
...
@@ -170,14 +167,8 @@ static void proxy_check_pointers( const var_list_t *args )
if
(
!
args
)
return
;
LIST_FOR_EACH_ENTRY
(
arg
,
args
,
const
var_t
,
entry
)
{
if
(
is_var_ptr
(
arg
)
&&
cant_be_null
(
arg
))
{
print_proxy
(
"if(!%s)
\n
"
,
arg
->
name
);
indent
++
;
print_proxy
(
"RpcRaiseException(RPC_X_NULL_REF_POINTER);
\n
"
);
indent
--
;
}
}
if
(
cant_be_null
(
arg
))
print_proxy
(
"if (!%s) RpcRaiseException(RPC_X_NULL_REF_POINTER);
\n
"
,
arg
->
name
);
}
static
void
free_variable
(
const
var_t
*
arg
,
const
char
*
local_var_prefix
)
...
...
tools/widl/widltypes.h
View file @
fa2b886d
...
...
@@ -544,7 +544,6 @@ void clear_all_offsets(void);
int
is_ptr
(
const
type_t
*
t
);
int
is_array
(
const
type_t
*
t
);
int
is_var_ptr
(
const
var_t
*
v
);
int
cant_be_null
(
const
var_t
*
v
);
#define tsENUM 1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment