Преглед изворни кода

Fix potential NULL pointer dereference

Mathieu Eyraud пре 5 месеци
родитељ
комит
d17b8412f1
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/io/io_uring/SDL_asyncio_liburing.c

+ 1 - 1
src/io/io_uring/SDL_asyncio_liburing.c

@@ -252,7 +252,7 @@ static SDL_AsyncIOTask *ProcessCQE(LibUringAsyncIOQueueData *queuedata, struct i
             }
         }
 
-        if ((task->type == SDL_ASYNCIO_TASK_CLOSE) && task->flush) {
+        if (task && (task->type == SDL_ASYNCIO_TASK_CLOSE) && task->flush) {
             task->flush = false;
             task = NULL;  // don't return this one, it's a linked task, so it'll arrive in a later CQE.
         }