diff --git a/plugins/sudoers/timestamp.c b/plugins/sudoers/timestamp.c index ace568e5a..dfc9bdfc5 100644 --- a/plugins/sudoers/timestamp.c +++ b/plugins/sudoers/timestamp.c @@ -643,8 +643,8 @@ timestamp_lock(void *vcookie, struct passwd *pw) if (entry.size == sizeof(struct timestamp_entry_v1)) { /* Old sudo record, convert it to TS_LOCKEXCL. */ entry.type = TS_LOCKEXCL; - memset((char *)&entry + offsetof(struct timestamp_entry, type), 0, - nread - offsetof(struct timestamp_entry, type)); + memset((char *)&entry + offsetof(struct timestamp_entry, flags), 0, + nread - offsetof(struct timestamp_entry, flags)); if (ts_write(cookie->fd, cookie->fname, &entry, 0) == -1) debug_return_bool(false); } else {