Undefined behavior with memcpy in AuthRequired
Description
While testing Xfce and its dependencies with UndefinedBehaviorSanitizer, I triggered the following warning:
process.c:451:5: runtime error: null pointer passed as argument 2, which is declared to never be null
#0 0x7177edf2eff6 in AuthRequired libice/src/process.c:451
#1 0x7177edf33748 in ProcessConnectionSetup libice/src/process.c:1085
#2 0x7177edf3e6ab in _IceProcessCoreMessage libice/src/process.c:2516
#3 0x7177edf487fc in IceProcessMessages libice/src/process.c:335
#4 0x60d790f402c9 in ice_connection_accept xfce4-session/xfce4-session/ice-layer.c:197
#5 0x7177ee9f52de in g_io_unix_dispatch glib/giounix.c:170
#6 0x7177ee88ed06 in g_main_dispatch glib/gmain.c:3357
#7 0x7177ee88ed06 in g_main_context_dispatch_unlocked glib/gmain.c:4208
#8 0x7177ee89ba5a in g_main_context_iterate_unlocked glib/gmain.c:4273
#9 0x7177ee89d1be in g_main_loop_run glib/gmain.c:4475
#10 0x7177f15f7bd6 in gtk_main gtk/gtkmain.c:1329
#11 0x60d790f13981 in main xfce4-session/xfce4-session/main.c:398
The root cause seems to be that authData
is NULL on the following line, which can cause memcpy to receive NULL src data:
451 IceWriteData (iceConn, authDataLen, (char *) authData);
Version info
- 296eff6b compiled on Arch Linux