diff options
author | jmcneill <jmcneill@pkgsrc.org> | 2008-11-23 22:28:23 +0000 |
---|---|---|
committer | jmcneill <jmcneill@pkgsrc.org> | 2008-11-23 22:28:23 +0000 |
commit | 6173f3f5c15961b5168f54ea039cd2a4d8ee9d4a (patch) | |
tree | bad8fa109563d2bf9c5cba17706636a2f4e3f94f | |
parent | 54f4ebc240984adfd72a6b7748a8198c676251cd (diff) | |
download | pkgsrc-6173f3f5c15961b5168f54ea039cd2a4d8ee9d4a.tar.gz |
From FreeBSD:
Fix a problem with PK's strndup() implementation assuming all strings
passed to it would be NUL-terminated. This is known to fix crashes with
polkit-gnome-authorization and clock-applet.
-rw-r--r-- | security/policykit/distinfo | 3 | ||||
-rw-r--r-- | security/policykit/patches/patch-aj | 29 |
2 files changed, 31 insertions, 1 deletions
diff --git a/security/policykit/distinfo b/security/policykit/distinfo index fc880d7ebc4..31ad6eac416 100644 --- a/security/policykit/distinfo +++ b/security/policykit/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.2 2008/11/23 21:21:43 hasso Exp $ +$NetBSD: distinfo,v 1.3 2008/11/23 22:28:23 jmcneill Exp $ SHA1 (PolicyKit-0.9.tar.gz) = ac99c580eff72f6d5df261c155fb047306439f85 RMD160 (PolicyKit-0.9.tar.gz) = 197262d1c48e55558dd4bd57d7bbd8734666129c @@ -12,3 +12,4 @@ SHA1 (patch-af) = c15988b60a99443469a0399935bc51f99da4b454 SHA1 (patch-ag) = bfa1a32a26d80a3cbc90144ae137d4ad06832e61 SHA1 (patch-ah) = a1ae419a77bb3c8be02706bb67476af9443af92a SHA1 (patch-ai) = 9ec3744b394b0f6181a8a3367f0ce93e32b7fc4f +SHA1 (patch-aj) = 596b9eb54173e25176ba0f363e4b2c4c137dd89f diff --git a/security/policykit/patches/patch-aj b/security/policykit/patches/patch-aj new file mode 100644 index 00000000000..150de873a6a --- /dev/null +++ b/security/policykit/patches/patch-aj @@ -0,0 +1,29 @@ +$NetBSD: patch-aj,v 1.1 2008/11/23 22:28:23 jmcneill Exp $ + +--- src/kit/kit-string.c.orig 2008-05-30 17:24:44.000000000 -0400 ++++ src/kit/kit-string.c 2008-07-24 01:21:34.000000000 -0400 +@@ -123,13 +123,18 @@ static char + if ( !s ) + return NULL; + +- if ( strlen(s) > n ) +- nAvail = n + 1; +- else +- nAvail = strlen(s) + 1; +- p = malloc ( nAvail ); ++ if (memchr(s, '\0', n) != NULL) { ++ nAvail = strlen(s); ++ if ( nAvail > n ) ++ nAvail = n; ++ } else { ++ nAvail = n; ++ } ++ p = malloc ( nAvail + 1 ); ++ if (p == NULL) ++ return NULL; + memcpy ( p, s, nAvail ); +- p[nAvail - 1] = '\0'; ++ p[nAvail] = '\0'; + + return p; + } |