xelerance / Openswan

Openswan
Other
852 stars 214 forks source link

Add null check for aes key. #428

Closed AnatoliChe closed 4 years ago

AnatoliChe commented 4 years ago

If key is null it will be a segfault.

mcr commented 4 years ago

This looks fine. Please merge it.

AnatoliChe commented 4 years ago

I received a segfault at this function at random intervals once a day on a bad channel. After applying this patch, it has been working fine for six months. Sorry, I have no reliable way to reproduce this error, it was half a year ago.

But if I enable debug log I can see there messages like: "do_aes: enc key is NULL."

shussain commented 4 years ago

Thank you for the commit @AnatoliChe I have cherry-picked the fix to 2.6.52dev branch