Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | Subject: [PATCH] ipsec-tools: racoon: check several invalid ivm |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | |
| 5 | Add checking for invalid ivm, or it will crash racoon. |
| 6 | |
| 7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> |
| 8 | --- |
| 9 | isakmp_cfg.c | 5 +++++ |
| 10 | 1 file changed, 5 insertions(+) |
| 11 | |
| 12 | diff -urpN a/src/racoon/isakmp_cfg.c b/src/racoon/isakmp_cfg.c |
| 13 | --- a/src/racoon/isakmp_cfg.c |
| 14 | +++ b/src/racoon/isakmp_cfg.c |
| 15 | @@ -171,6 +171,11 @@ isakmp_cfg_r(iph1, msg) |
| 16 | iph1->mode_cfg->last_msgid != packet->msgid ) |
| 17 | iph1->mode_cfg->ivm = |
| 18 | isakmp_cfg_newiv(iph1, packet->msgid); |
| 19 | + if(iph1->mode_cfg->ivm == NULL) { |
| 20 | + plog(LLV_ERROR, LOCATION, NULL, |
| 21 | + "failed to create new IV\n"); |
| 22 | + return; |
| 23 | + } |
| 24 | ivm = iph1->mode_cfg->ivm; |
| 25 | |
| 26 | dmsg = oakley_do_decrypt(iph1, msg, ivm->iv, ivm->ive); |