alpine 3.7
format weakness #27


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.

File Name:



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

         fprintf(stderr, "Name Lost. Is Another notification daemon running?\n");

static RawImage * get_raw_image_from_data_hint(GVariant *icon_data)
    RawImage *image = g_malloc(sizeof(RawImage));
    GVariant *data_variant;
    gsize expected_len;

    g_variant_get (icon_data,

    expected_len = (image->height - 1) * image->rowstride + image->width
            * ((image->n_channels * image->bits_per_sample + 7) / 8);

    if (expected_len != g_variant_get_size (data_variant)) {
        fprintf(stderr, "Expected image data to be of length %" G_GSIZE_FORMAT
               " but got a " "length of %" G_GSIZE_FORMAT,
               g_variant_get_size (data_variant));
        return NULL;

    image->data = (guchar *) g_memdup (g_variant_get_data (data_variant),
                                g_variant_get_size (data_variant));

    return image;

int initdbus(void)
        guint owner_id;

        #if !GLIB_CHECK_VERSION(2,35,0)

        introspection_data = g_dbus_node_info_new_for_xml(introspection_xml,

        owner_id = g_bus_own_name(G_BUS_TYPE_SESSION, 

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.