As reported by Coverity:
CID 1228897 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)14. var_deref_model: Passing null pointer channel to get_program_and_store, which dereferences it. [show details]
1129 rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
1130 service_id, channel, NULL,
1131 get_detected, get_nit);
Well, get_program_and_store() explicitly tests if channel is null or
not, but it does it too late.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
if (rc)
dvb_logerr("Couldn't get frontend props");
}
+ if (!*channel) {
+ r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id);
+ if (r < 0)
+ dvb_perror("asprintf");
+ if (parms->p.verbose)
+ dvb_log("Storing as: '%s'", channel);
+ }
for (j = 0; j < parms->n_props; j++) {
entry->props[j].cmd = parms->dvb_prop[j].cmd;
entry->props[j].u.data = parms->dvb_prop[j].u.data;
freq = parms->dvb_prop[j].u.data;
}
entry->n_props = parms->n_props;
-
- if (!*channel) {
- r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id);
- if (r < 0)
- dvb_perror("asprintf");
- if (parms->p.verbose)
- dvb_log("Storing as: '%s'", channel);
- }
entry->channel = channel;
if (get_nit)