qulogic/libgnt

Parents 7c23169d215b
Children e92f56c72c59
gnt: Fix use-after-free memory violation during Python initialization

Turns out there never was a reason to allocate a wide-character string on the heap to begin with; C has wide-character string literals.
  • +1 -7
    gntwm.c
  • --- a/gntwm.c Tue May 01 16:15:28 2018 -0400
    +++ b/gntwm.c Fri May 25 16:48:10 2018 +0200
    @@ -1560,13 +1560,7 @@
    GNT_KEY_F3, NULL);
    if (!Py_IsInitialized()) {
    #if PY_MAJOR_VERSION >= 3
    - wchar_t *name;
    - size_t len;
    - len = mbstowcs(NULL, "gnt", 0);
    - name = g_new(wchar_t, len + 1);
    - mbstowcs(name, "gnt", len + 1);
    - Py_SetProgramName(name);
    - g_free(name);
    + Py_SetProgramName(L"gnt");
    #else
    Py_SetProgramName("gnt");
    #endif