fedora 24
format weakness #52


Weakness Breakdown


A format string exploit occurs when the data of an input string is evaluated as a command by the program. This class of attacks is very similar to buffer overflows since an attacker could execute code, read the stack or cause new behaviors that compromise security. Learn more about format string attacks on OWASP attack index.

Warning code(s):

If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always 0-terminate.

File Name:



The highlighted line of code below is the trigger point of this particular Fedora 24 format weakness.

                 memmove(exe_name, slash+1, strlen(slash)+1);


    return exe_name;
#ifdef __GNUC__
#warning "avahi_exe_name() needs to be implemented for your operating system"
    return "(unknown)";

void avahi_warn(const char *fmt, ...) {
    char msg[512]  = "*** WARNING *** ";
    va_list ap;
    size_t n;


    va_start(ap, fmt);
    n = strlen(msg);
    vsnprintf(msg + n, sizeof(msg) - n, fmt, ap);

    fprintf(stderr, "%s\n", msg);

    openlog(avahi_exe_name(), LOG_PID, LOG_USER);
    syslog(LOG_WARNING, "%s", msg);

void avahi_warn_linkage(void) {
    int w;

    w = linkage_warning;
    linkage_warning = 1;

    if (!w && !getenv("AVAHI_COMPAT_NOWARN")) {
        avahi_warn("The program '%s' uses the "COMPAT_LAYER" compatibility layer of Avahi.", avahi_exe_name());
        avahi_warn("Please fix your application to use the native API of Avahi!");
        avahi_warn("For more information see <http://0pointer.de/avahi-compat?s="CGI_SUBSYSTEM"&e=%s>", avahi_exe_name());

void avahi_warn_unsupported(const char *function) { 

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.