fedora 25
integer weakness #24


Weakness Breakdown


An integer overflow occurs when the answer to an arithmetic operation exceeds the maximum size of the integer type used to store it. The resulting value will appear to have wrapped around the maximum value and started again at the minimum value. This would look like a clock that represents 13:00 by pointing at 1:00. An attacker can use an integer overflow during a buffer length calculation, which results in the allocated buffer being too small to hold the data copied into it, thus causing a buffer overflow.

Warning code(s):

Unless checked, the resulting number can exceed the expected range.

File Name:



The highlighted line of code below is the trigger point of this particular Fedora 25 integer weakness.

     char *tmp = xstrdup(val);

    ch= tmp[0];		/* save wordlist type (good/spam) */
    tmp = spanword(tmp);

    switch (toupper((unsigned char)ch))
    case 'R':
	type = WL_REGULAR;
    case 'I':
	type = WL_IGNORE;
	fprintf( stderr, "Unknown wordlist type - '%c'\n", ch);
	return (false);

    listname=tmp;		/* name of wordlist */
    tmp = spanword(tmp);

    filename=tmp;		/* path to wordlist */
    tmp = spanword(tmp);


    init_wordlist(listname, filename, precedence, type);

    return true;

/* print error and exit */

void wordlist_error(int err)
    if (err == ENOENT)
		"Remember to register some spam and ham messages before you\n"
		"use bogofilter to evaluate mail for its probable spam status!\n");

    if (err == EINVAL)
		"Make sure that the database version this program is linked against\n"
		"can handle the format of the data base file (after updates in particular).\n");


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.