Skip to content

Commit

Permalink
make sure tlen refletcts pbuf size. Greg Troxel
Browse files Browse the repository at this point in the history
  • Loading branch information
itojun committed Oct 3, 2003
1 parent d78fd7e commit 46011a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kame/kame/libipsec/policy_parse.y
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $KAME: policy_parse.y,v 1.16 2003/10/03 21:51:13 itojun Exp $ */
/* $KAME: policy_parse.y,v 1.17 2003/10/03 21:52:11 itojun Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, 1998, and 1999 WIDE Project.
Expand Down Expand Up @@ -293,13 +293,13 @@ init_x_policy()
{
struct sadb_x_policy *p;

tlen = sizeof(struct sadb_x_policy);

pbuf = malloc(tlen);
if (pbuf == NULL) {
__ipsec_errcode = EIPSEC_NO_BUFS;
return -1;
}
tlen = sizeof(struct sadb_x_policy);

memset(pbuf, 0, tlen);
p = (struct sadb_x_policy *)pbuf;
p->sadb_x_policy_len = 0; /* must update later */
Expand Down

0 comments on commit 46011a1

Please sign in to comment.