~ubuntu-branches/ubuntu/breezy/pam/breezy

« back to all changes in this revision

Viewing changes to debian/patches-applied/037_pam_issue_ttyname_can_be_null

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2004-06-28 14:28:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040628142808-adikk7vtfg3pzcjw
Tags: 0.76-22
* Add uploaders
* Document location of repository
* Fix options containing arguments in pam_unix, Closes: #254904

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Bug #153152 %l can cause
 
2
segfault if ttyname is null
 
3
 
 
4
Index: Linux-PAM/modules/pam_issue/pam_issue.c
 
5
===================================================================
 
6
RCS file: /afs/sipb/project/debian/cvs/pam/Linux-PAM/modules/pam_issue/pam_issue.c,v
 
7
retrieving revision 1.1.1.2
 
8
diff -u -r1.1.1.2 pam_issue.c
 
9
--- Linux-PAM/modules/pam_issue/pam_issue.c     15 Sep 2002 20:08:49 -0000      1.1.1.2
 
10
+++ Linux-PAM/modules/pam_issue/pam_issue.c     25 Nov 2002 01:15:40 -0000
 
11
@@ -235,9 +235,13 @@
 
12
              case 'l':
 
13
                {
 
14
                    char *ttyn = ttyname(1);
 
15
-                   if (!strncmp(ttyn, "/dev/", 5))
 
16
+                   if (ttyn) {
 
17
+                     if (!strncmp(ttyn, "/dev/", 5))
 
18
                        ttyn += 5;
 
19
-                   snprintf (buf, 1024, "%s", ttyn);
 
20
+                     snprintf (buf, 1024, "%s", ttyn);
 
21
+                   } else {
 
22
+                     buf[0] = '\0';
 
23
+                   }
 
24
                }
 
25
                break;
 
26
              case 'u':