openac: Make sure path is null-terminated.
authorTobias Brunner <tobias@strongswan.org>
Tue, 19 Apr 2011 11:22:32 +0000 (13:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 19 Apr 2011 11:48:51 +0000 (13:48 +0200)
src/openac/openac.c

index 5de8f5b..086db9e 100755 (executable)
@@ -39,8 +39,8 @@
 #include <credentials/sets/mem_cred.h>
 #include <utils/optionsfrom.h>
 
-#define OPENAC_PATH            IPSEC_CONFDIR "/openac"
-#define OPENAC_SERIAL          IPSEC_CONFDIR "/openac/serial"
+#define OPENAC_PATH                    IPSEC_CONFDIR "/openac"
+#define OPENAC_SERIAL          IPSEC_CONFDIR "/openac/serial"
 
 #define DEFAULT_VALIDITY       24*3600         /* seconds */
 
@@ -300,6 +300,7 @@ int main(int argc, char **argv)
                                        if (*optarg == '/')     /* absolute pathname */
                                        {
                                                strncpy(path, optarg, BUF_LEN);
+                                               path[BUF_LEN-1] = '\0';
                                        }
                                        else                    /* relative pathname */
                                        {