Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/ipsec-tools Fix parse bug in IPsec policies



details:   https://anonhg.NetBSD.org/src/rev/7f18b5ce6029
branches:  trunk
changeset: 581003:7f18b5ce6029
user:      manu <manu%NetBSD.org@localhost>
date:      Fri May 20 00:57:33 2005 +0000

description:
Fix parse bug in IPsec policies

diffstat:

 crypto/dist/ipsec-tools/ChangeLog                   |  4 ++++
 crypto/dist/ipsec-tools/src/libipsec/policy_parse.y |  8 ++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r b1c21eca9c25 -r 7f18b5ce6029 crypto/dist/ipsec-tools/ChangeLog
--- a/crypto/dist/ipsec-tools/ChangeLog Fri May 20 00:54:55 2005 +0000
+++ b/crypto/dist/ipsec-tools/ChangeLog Fri May 20 00:57:33 2005 +0000
@@ -5,6 +5,10 @@
          altering lifetime, duplicate the proposal instead of modifying 
          the configured one.
 
+2005-05-14  Emmanuel Dreyfus  <manu%netbsd.org@localhost>
+
+       * src/libipsec/policy_parse.y: fix parse bug in IPsec policies
+
 2005-05-13  Emmanuel Dreyfus  <manu%netbsd.org@localhost>
 
        * src/racoon/isakmp.c: For acquire messages, when NAT-T is in use,
diff -r b1c21eca9c25 -r 7f18b5ce6029 crypto/dist/ipsec-tools/src/libipsec/policy_parse.y
--- a/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y       Fri May 20 00:54:55 2005 +0000
+++ b/crypto/dist/ipsec-tools/src/libipsec/policy_parse.y       Fri May 20 00:57:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: policy_parse.y,v 1.2 2005/05/08 08:57:26 manu Exp $    */
+/*     $NetBSD: policy_parse.y,v 1.3 2005/05/20 00:57:33 manu Exp $    */
 
 /*     $KAME: policy_parse.y,v 1.21 2003/12/12 08:01:26 itojun Exp $   */
 
@@ -417,8 +417,12 @@
        }
 
        strncpy(addr, addrbuf->buf, addrbuf->len);
-       if (portbuf)
+       addr[addrbuf->len] = '\0';
+
+       if (portbuf) {
                strncpy(serv, portbuf->buf, portbuf->len);
+               serv[portbuf->len] = '\0';
+       }
 
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = PF_UNSPEC;



Home | Main Index | Thread Index | Old Index