alpine 3.6
obsolete weakness #78

1

Weakness Breakdown


Definition:

An obsolete weakness occurs when someone uses deprecated or obsolete functions when building a system. As a programming language evolves, some functions occasionally become obsolete.

Warning code(s):

This C routine is considered obsolete.

File Name:

v4l-utils/src/v4l-utils-1.12.5/lib/libdvbv5/dvb-file.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.6 obsolete weakness.

 			free(channel);
		if (vchannel)
			free(vchannel);
		return -1;
	}

	/* Initialize data */
	entry->service_id = service_id;
	entry->vchannel = vchannel;
	entry->sat_number = parms->p.sat_number;
	entry->freq_bpf = parms->p.freq_bpf;
	entry->diseqc_wait = parms->p.diseqc_wait;
	if (parms->p.lnb)
		entry->lnb = strdup(parms->p.lnb->alias);

	/* Get PIDs for each elementary inside the service ID */
	get_pmt_descriptors(entry, dvb_scan_handler->program[i].pmt);

	/* Copy data from parms */
	if (get_detected) {
		int rc;
		do {
			rc = dvb_fe_get_parms(&parms->p);
			if (rc == EAGAIN)
				usleep(100000);
		} while (rc == EAGAIN);
		if (rc)
			dvb_logerr(_("Couldn't get frontend props"));
	}
	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;

		/* [ISDB-S]
		 * Update DTV_STREAM_ID if it was not specified by a user
		 * or set to a wrong one.
		 * In those cases, demod must have selected the first TS_ID.
		 * The update must be after the above dvb_fe_get_parms() call,
		 * since a lazy FE driver that does not update stream_id prop
		 * cache in FE.get_frontend() may overwrite the setting again
		 * with the initial / user-specified wrong value.
		 */
		if (entry->props[j].cmd == DTV_STREAM_ID
		    && entry->props[j].u.data == 0
		    && parms->p.current_sys == SYS_ISDBS)
			entry->props[j].u.data = dvb_scan_handler->pat->header.id;

		if (!channel && entry->props[j].cmd == DTV_FREQUENCY)
			freq = parms->dvb_prop[j].u.data;
	} 

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner of the mark on a world­wide basis.