acl-plugin: fix coverity error in acl_test.c 37/7037/2
authorAndrew Yourtchenko <ayourtch@gmail.com>
Wed, 7 Jun 2017 10:30:48 +0000 (12:30 +0200)
committerDamjan Marion <dmarion.lists@gmail.com>
Wed, 7 Jun 2017 12:41:39 +0000 (12:41 +0000)
commit0018a3e54efcf6dfbc08ae307b366ee6c4fb3257
tree1d21283d7b5a0e5f1196c65521fea5b39c6d68f8
parent539ed4fee56aaec0f44508ed2baa24beb1c678f8
acl-plugin: fix coverity error in acl_test.c

Attempting to supply within a VAT CLI to add the ACLs a rule count
override with no rules to add would result in null pointer dereference
as we attempt to copy those rules to the message.
Add the check to avoid copy if the source pointer is null
(i.e. if there are no rules to copy from).
This commit fixes coverity errors 166797 and 166792.

Change-Id: Icabe060d961ba07dc41f63b8e17fca12ff82aa29
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/plugins/acl/acl_test.c