Kaynağa Gözat

win-wasapi: Fix potential null pointer deref in enumeration

jp9000 8 yıl önce
ebeveyn
işleme
b5581938ca
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      plugins/win-wasapi/enum-wasapi.cpp

+ 1 - 1
plugins/win-wasapi/enum-wasapi.cpp

@@ -20,7 +20,7 @@ string GetDeviceName(IMMDevice *device)
 		PropVariantInit(&nameVar);
 		res = store->GetValue(PKEY_Device_FriendlyName, &nameVar);
 
-		if (SUCCEEDED(res)) {
+		if (SUCCEEDED(res) && nameVar.pwszVal && *nameVar.pwszVal) {
 			size_t len = wcslen(nameVar.pwszVal);
 			size_t size;