igzip: Fix order of args check in new dictionary function

In the newly added function isal_deflate_process_dict(), a null check
was added to the dictionary struct but was ineffectual because of the
order.

Change-Id: I3b3e70997210794de102b1348e1467295871cee2
Signed-off-by: Greg Tucker <greg.b.tucker@intel.com>
This commit is contained in:
Greg Tucker 2020-11-02 19:11:18 -07:00
parent 24a98e3e87
commit 269df8a67d

View File

@ -1244,9 +1244,9 @@ void isal_deflate_hash(struct isal_zstream *stream, uint8_t * dict, uint32_t dic
int isal_deflate_process_dict(struct isal_zstream *stream, struct isal_dict *dict,
uint8_t * dict_data, uint32_t dict_len)
{
if ((dict->level > ISAL_DEF_MAX_LEVEL)
if ((dict == NULL)
|| (dict_len == 0)
|| (dict == NULL))
|| (dict->level > ISAL_DEF_MAX_LEVEL))
return ISAL_INVALID_STATE;
if (dict_len > IGZIP_HIST_SIZE) {