789913047c8a9dbf7e6d4c7b97100e5b13c506ae
[debian/sudo] / debian / patches / fix-segfault-on-start.diff
1 Fixes segfault on startup under certain conditions
2 --- a/src/utmp.c
3 +++ b/src/utmp.c
4 @@ -96,7 +96,7 @@
5      size_t idlen;
6  
7      /* Skip over "tty" in the id if old entry did too. */
8 -    if (strncmp(line, "tty", 3) == 0) {
9 +    if (old != NULL && strncmp(line, "tty", 3) == 0) {
10         idlen = MIN(sizeof(old->ut_id), 3);
11         if (strncmp(old->ut_id, "tty", idlen) != 0)
12             line += 3;