alpine 3.9
obsolete weakness #536

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:

dahdi-tools/src/dahdi-tools-2.11.1/hdlcstress.c

Context:

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

 		fprintf(stderr, "Unable to get buf info: %s\n", strerror(errno));
		exit(1);
	}
	ioctl(fd, DAHDI_GETEVENT);
	fasthdlc_precalc();
	fasthdlc_init(&fs, FASTHDLC_MODE_64);
#if 0
	print_packet(outbuf, res);
	printf("FCS is %x, PPP_GOODFCS is %x\n",
	fcs,PPP_GOODFCS);
#endif
	for(;;) {
		if (c < 1)
			c = 1;
		for (x=0;x<50;x++) {
			outbuf[x] = c;
		}
		send_packet(outbuf, 50);
#if 0
		printf("Wrote %d of %d bytes\n", res, c);
#endif		
		/* The HFC chip can't be bombarded too much. If a write has 
		   failed, let it recover */
		if (bri_delay)
			usleep(bri_delay);

		c = bit_next(c);
#if 0
		printf("(%d) Wrote %d bytes\n", packets++, res);
#endif
	}
	
} 

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.