From f80966f830a138f1ccdaff86d615b71b15be2537 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Mon, 26 Sep 2011 21:56:19 -0600 Subject: [PATCH] patch to fix segfault on startup under certain conditions --- debian/changelog | 4 +++- debian/patches/fix-segfault-on-start.diff | 12 ++++++++++++ debian/patches/series | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 debian/patches/fix-segfault-on-start.diff diff --git a/debian/changelog b/debian/changelog index 4d89444..e04a986 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,10 @@ sudo (1.8.2-2) UNRELEASED; urgency=low * patch from upstream for SIGBUS on sparc64, closes: #640304 * use common-session-noninteractive in the pam config to reduce log noise when sudo is used in cron, etc, closes: #519700 + * patch from Steven McDonald to fix segfault on startup under certain + conditions, closes: #639568 - -- Bdale Garbee Mon, 26 Sep 2011 20:33:40 -0600 + -- Bdale Garbee Mon, 26 Sep 2011 21:55:56 -0600 sudo (1.8.2-1) unstable; urgency=low diff --git a/debian/patches/fix-segfault-on-start.diff b/debian/patches/fix-segfault-on-start.diff new file mode 100644 index 0000000..7899130 --- /dev/null +++ b/debian/patches/fix-segfault-on-start.diff @@ -0,0 +1,12 @@ +Fixes segfault on startup under certain conditions +--- a/src/utmp.c ++++ b/src/utmp.c +@@ -96,7 +96,7 @@ + size_t idlen; + + /* Skip over "tty" in the id if old entry did too. */ +- if (strncmp(line, "tty", 3) == 0) { ++ if (old != NULL && strncmp(line, "tty", 3) == 0) { + idlen = MIN(sizeof(old->ut_id), 3); + if (strncmp(old->ut_id, "tty", idlen) != 0) + line += 3; diff --git a/debian/patches/series b/debian/patches/series index 4e3aa5b..be55d1e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ typo-in-classic-insults.diff paths-in-samples.diff upstream-sigbus-fix +fix-segfault-on-start.diff -- 2.47.2