From c401aa784839a4d80d5ce4237bc6592d81341655 Mon Sep 17 00:00:00 2001 From: branch-fixup Date: Sun, 23 Nov 2008 22:28:23 +0000 Subject: [PATCH] Add files from parent branch HEAD: security/policykit/patches/patch-aj --- security/policykit/patches/patch-aj | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 security/policykit/patches/patch-aj diff --git a/security/policykit/patches/patch-aj b/security/policykit/patches/patch-aj new file mode 100644 index 000000000000..44886e0e279a --- /dev/null +++ b/security/policykit/patches/patch-aj @@ -0,0 +1,29 @@ +$NetBSD$ + +--- 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; + } -- 2.41.0