alpine 3.7
buffer weakness #7

5

Weakness Breakdown


Definition:

Buffer overflows are one of the most well-known software vulnerabilities. Even though most developers know what buffer overflows are, attacks against the vulnerabilities are common in both legacy and newer applications. A classic buffer overflow exploit begins with the attacker sending data to a program, which it then stores in an undersized stack buffer. Besides stack buffer overflows, other kinds of buffer overflows include heap overflows, off-by-one errors and many others. Learn more about buffer overflows on OWASP attack index.

Warning code(s):

Does not check for buffer overflows.

File Name:

cdrkit/src/cdrkit-1.1.11/wodim/fifo.c

Context:

The highlighted line of code below is the trigger point of this particular Alpine 3.7 buffer weakness.

 }

void
fifo_stats()
{
	if (sp == NULL)	/* We might not use a FIFO */
		return;

	errmsgno(EX_BAD, "fifo had %ld puts and %ld gets.\n",
		sp->puts, sp->gets);
	errmsgno(EX_BAD, "fifo was %ld times empty and %ld times full, min fill was %ld%%.\n",
		sp->empty, sp->full, (100L*sp->cont_low)/faio_buffers);
}

int
fifo_percent(BOOL addone)
{
	int	percent;

	if (sp == NULL)	/* We might not use a FIFO */
		return (-1);

	if (sp->done)
		return (100);
	percent = (100*(sp->puts + 1 - sp->gets)/faio_buffers);
	if (percent > 100)
		return (100);
	return (percent);
}
#else	/* FIFO */

#include <standard.h>
#include <utypes.h>	/* includes sys/types.h */
#include <schily.h>

#include "wodim.h"

void	init_fifo(long);
BOOL	init_faio(track_t *track, int);
BOOL	await_faio(void);
void	kill_faio(void);
int	wait_faio(void);
int	faio_read_buf(int f, char *bp, int size);
int	faio_get_buf(int f, char **bpp, int size);
void	fifo_stats(void);
int	fifo_percent(BOOL addone);


void init_fifo(long fs)
{ 

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.