@@ -627,7 +627,7 @@ handle_restart(const RestartMessage *msg, const uint8_t *buf, size_t len,
627627 }
628628
629629 /* Check that message is valid. */
630- if (msg == NULL || msg -> log_id [0 ] == '\0' || msg -> resume_point == NULL ) {
630+ if (msg == NULL || msg -> log_id [0 ] == '\0' || ! valid_timespec ( msg -> resume_point ) ) {
631631 sudo_warnx (U_ ("%s: %s" ), source , U_ ("invalid RestartMessage" ));
632632 closure -> errstr = _ ("invalid RestartMessage" );
633633 debug_return_bool (false);
@@ -711,11 +711,12 @@ handle_iobuf(int iofd, const IoBuffer *iobuf, const uint8_t *buf, size_t len,
711711 }
712712
713713 /* Check that message is valid. */
714- if (iobuf == NULL || iobuf -> delay == NULL || iobuf -> data . len == 0 ) {
714+ if (iobuf == NULL || iobuf -> data . len == 0 || ! valid_timespec ( iobuf -> delay ) ) {
715715 sudo_warnx (U_ ("%s: %s" ), source , U_ ("invalid IoBuffer" ));
716716 closure -> errstr = _ ("invalid IoBuffer" );
717717 debug_return_bool (false);
718718 }
719+
719720 sudo_debug_printf (SUDO_DEBUG_INFO , "%s: received IoBuffer from %s" ,
720721 source , __func__ );
721722
@@ -758,7 +759,7 @@ handle_winsize(const ChangeWindowSize *msg, const uint8_t *buf, size_t len,
758759 }
759760
760761 /* Check that message is valid. */
761- if (msg == NULL || msg -> delay == NULL ) {
762+ if (msg == NULL || ! valid_timespec ( msg -> delay ) ) {
762763 sudo_warnx (U_ ("%s: %s" ), source , U_ ("invalid ChangeWindowSize" ));
763764 closure -> errstr = _ ("invalid ChangeWindowSize" );
764765 debug_return_bool (false);
@@ -794,7 +795,7 @@ handle_suspend(const CommandSuspend *msg, const uint8_t *buf, size_t len,
794795 }
795796
796797 /* Check that message is valid. */
797- if (msg == NULL || msg -> delay == NULL ) {
798+ if (msg == NULL || ! valid_timespec ( msg -> delay ) ) {
798799 sudo_warnx (U_ ("%s: %s" ), source , U_ ("invalid CommandSuspend" ));
799800 closure -> errstr = _ ("invalid CommandSuspend" );
800801 debug_return_bool (false);
0 commit comments