dm: refine 'assert' in inout.c and post.c

- 'assert' cleanup to avoid possible software vulnerabilities.

Tracked-On: #3252
Signed-off-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
Yonghua Huang
2019-06-17 18:27:31 +08:00
committed by wenlingz
parent a2332b159a
commit dedf9befa6
2 changed files with 9 additions and 12 deletions

View File

@@ -26,8 +26,6 @@
* $FreeBSD$
*/
#include <assert.h>
#include "inout.h"
#include "lpc.h"
@@ -35,9 +33,7 @@ static int
post_data_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes,
uint32_t *eax, void *arg)
{
assert(in == 1);
if (bytes != 1)
if ((in != 1) || (bytes != 1))
return -1;
*eax = 0xff; /* return some garbage */