centos 6
obsolete weakness #32

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:

spice-0.8.2/client/x11/red_window.cpp

Context:

The highlighted line of code below is the trigger point of this particular Centos 6 obsolete weakness.

     }

    AutoXErrorHandler auto_error_handler;
    int position_retries = Z_POSITION_RETRIES;
    for (;; --position_retries) {
        Window sibling = get_window_for_reposition(after->get_window());
        Window self = get_window_for_reposition(_win);
        if (sibling != None && self != None) {
            XWindowChanges changes;
            changes.sibling = sibling;
            changes.stack_mode = Below;
            x_error = Success;
            XConfigureWindow(x_display, self, CWSibling | CWStackMode, &changes);
            if (x_error == Success) {
                break;
            }
            if (x_error != BadWindow) {
                THROW("XConfigureWindow failed");
            }
        }

        if (!position_retries) {
            THROW("failed");
        }
        usleep(X_RETRY_DELAY_MICRO);
    }
    if (position_retries < Z_POSITION_RETRIES) {
        DBG(0, "retries %d", (Z_POSITION_RETRIES - position_retries));
    }
}

void RedWindow::show(int screen_id)
{
    if (_visibale) {
        return;
    }

    bool wait_parent;

    if (screen_id != _screen) {
        _listener.pre_migrate();
        migrate(*this, *(PixelsSource_p*)get_opaque(), screen_id);
        _listener.post_migrate();
    }

    /* We must update min/max for fullscreen / normal switching */
    set_minmax(*(PixelsSource_p*)get_opaque());

    if (_type == TYPE_FULLSCREEN) {
        Atom state[2]; 

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.