alpine 3.6
obsolete weakness #77

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-dev-remote.c

Context:

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

 {
	/* FIXME: not implemented yet*/
	return NULL;
}

static void dvb_dev_remote_free(struct dvb_device_priv *dvb)
{
	struct dvb_dev_remote_priv *priv = dvb->priv;
	struct queued_msg *msg, *next;
	int timer = 0;

	/*
	 * If the application was well-written, the last message would be
	 * a dev_close(). At this point, no other log messages should
	 * happen.
	 */

	pthread_cancel(priv->recv_id);

	/* Cancel any pending messages */
	dvb_dev_remote_disconnect(priv);

	/* Give some time any pending message to be handled */
	do {
		usleep(1000);
		timer++;
	} while (timer < 1000 && priv->msgs.next);

	/* Free any pending message */
	msg = priv->msgs.next;
	while (msg) {
		next = msg->next;
		free(msg);
		msg = next;
	}

	pthread_mutex_destroy(&priv->lock_io);

	/* Close the socket */
	if (priv->fd > 0) {
		close(priv->fd);
		priv->fd = 0;
	}

	free(priv);
}

int dvb_dev_remote_init(struct dvb_device *d, char *server, int port)
{
	struct dvb_device_priv *dvb = (void *)d; 

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.