提交 d1f225e2 编写于 作者: J jp9000

libobs/callback: Set default return values to 0/NULL

These functions created stack variables but never actually initialized
them.  If the calldata variable is invalid, the return values will be
the uninitialized stack value.
上级 09170692
...@@ -131,7 +131,7 @@ static inline bool calldata_bool(const calldata_t *data, const char *name) ...@@ -131,7 +131,7 @@ static inline bool calldata_bool(const calldata_t *data, const char *name)
static inline void *calldata_ptr(const calldata_t *data, const char *name) static inline void *calldata_ptr(const calldata_t *data, const char *name)
{ {
void *val; void *val = NULL;
calldata_get_ptr(data, name, &val); calldata_get_ptr(data, name, &val);
return val; return val;
} }
...@@ -139,7 +139,7 @@ static inline void *calldata_ptr(const calldata_t *data, const char *name) ...@@ -139,7 +139,7 @@ static inline void *calldata_ptr(const calldata_t *data, const char *name)
static inline const char *calldata_string(const calldata_t *data, static inline const char *calldata_string(const calldata_t *data,
const char *name) const char *name)
{ {
const char *val; const char *val = NULL;
calldata_get_string(data, name, &val); calldata_get_string(data, name, &val);
return val; return val;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册