[PATCH 1 of 2] Make sure that retval is terminated

Wald Commits scm-commit at wald.intevation.org
Thu Apr 24 12:32:38 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1398335503 0
# Node ID e8d761c2d2d12ecbf12814af8b80913b030db822
# Parent  6c4f526a4c5b618f3890bccedeb55830b635c4d4
Make sure that retval is terminated

diff -r 6c4f526a4c5b -r e8d761c2d2d1 cinst/nssstore_linux.c
--- a/cinst/nssstore_linux.c	Thu Apr 24 09:41:42 2014 +0000
+++ b/cinst/nssstore_linux.c	Thu Apr 24 10:31:43 2014 +0000
@@ -66,6 +66,7 @@
   path_len = strlen (buf);
   retval = xmalloc (path_len + 1);
   strncpy (retval, buf, path_len);
+  retval[path_len] = '\0';
 
   return retval;
 }


More information about the Trustbridge-commits mailing list