Skip to content

Commit ba5c390

Browse files
committed
[CTL] Add size check for umfCtlExec
1 parent 10f9451 commit ba5c390

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libumf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ umf_result_t umfCtlExec(const char *name, void *ctx, void *arg, size_t size) {
127127
if (name == NULL) {
128128
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
129129
}
130+
if ((arg == NULL && size != 0) || (arg != NULL && size == 0)) {
131+
return UMF_RESULT_ERROR_INVALID_ARGUMENT;
132+
}
130133

131134
return ctl_query(NULL, ctx, CTL_QUERY_PROGRAMMATIC, name,
132135
CTL_QUERY_RUNNABLE, arg, size)

0 commit comments

Comments
 (0)