Ver Fonte

SDL_UDEV_DelCallback: return early if _this is NULL

Fixes https://github.com/libsdl-org/SDL/issues/6548
(cherry picked from commit 6dc96aa7455d00a3556618a4a459851424ae5d44)
Ozkan Sezer há 3 anos atrás
pai
commit
c1307133ce
1 ficheiros alterados com 4 adições e 0 exclusões
  1. 4 0
      src/core/linux/SDL_udev.c

+ 4 - 0
src/core/linux/SDL_udev.c

@@ -544,6 +544,10 @@ SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
     SDL_UDEV_CallbackList *item;
     SDL_UDEV_CallbackList *prev = NULL;
 
+    if (_this == NULL) {
+        return;
+    }
+
     for (item = _this->first; item != NULL; item = item->next) {
         /* found it, remove it. */
         if (item->callback == cb) {