mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 22:35:10 +00:00
Zero out struct iolog_details early to avoid a potential (though
unlikely) dereference of stack garbage if we hit a fatal error before iolog_deserialize_info() is called.
This commit is contained in:
@@ -361,7 +361,6 @@ iolog_deserialize_info(struct iolog_details *details, char * const user_info[],
|
|||||||
gid_t runas_gid = 0;
|
gid_t runas_gid = 0;
|
||||||
debug_decl(iolog_deserialize_info, SUDO_DEBUG_UTIL)
|
debug_decl(iolog_deserialize_info, SUDO_DEBUG_UTIL)
|
||||||
|
|
||||||
memset(details, 0, sizeof(*details));
|
|
||||||
details->lines = 24;
|
details->lines = 24;
|
||||||
details->cols = 80;
|
details->cols = 80;
|
||||||
|
|
||||||
@@ -534,6 +533,8 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
|
|||||||
if (argc == 0)
|
if (argc == 0)
|
||||||
debug_return_bool(true);
|
debug_return_bool(true);
|
||||||
|
|
||||||
|
memset(&details, 0, sizeof(details));
|
||||||
|
|
||||||
if (error_setjmp() != 0) {
|
if (error_setjmp() != 0) {
|
||||||
/* called via error(), errorx() or log_fatal() */
|
/* called via error(), errorx() or log_fatal() */
|
||||||
rval = -1;
|
rval = -1;
|
||||||
|
Reference in New Issue
Block a user