qcacmn: Fix potential NULL pointer access in qdf_ini_parse()

In qdf_ini_parse(), verify that section_cb pointer is valid
to prevent invalid memory access.

Change-Id: Ie3d2e513e2aabf0bd5f9702578074cb1191991c1
Dieser Commit ist enthalten in:
Debasis Das
2021-07-16 13:22:06 +05:30
committet von Gerrit - the friendly Code Review server
Ursprung e831cf3415
Commit 1ae342f91a

Datei anzeigen

@@ -112,7 +112,11 @@ QDF_STATUS qdf_ini_parse(const char *ini_path, void *context,
qdf_err("Invalid *.ini syntax '%s'", key);
} else {
key[len - 1] = '\0';
status = section_cb(context, key + 1);
if (section_cb)
status = section_cb(context, key + 1);
else
status = QDF_STATUS_E_NULL_VALUE;
if (QDF_IS_STATUS_ERROR(status))
goto free_fbuf;
}