mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-17 19:25:39 +00:00
[Coverity] Add proper NULL check before comparison
This commit is contained in:
@@ -1187,7 +1187,7 @@ RENDERDOC_CreateRemoteServerConnection(const char *host, uint32_t port, RemoteSe
|
||||
if(host != NULL && host[0] != '\0')
|
||||
s = host;
|
||||
|
||||
if(!strncmp(host, "adb:", 4))
|
||||
if(host != NULL && !strncmp(host, "adb:", 4))
|
||||
{
|
||||
s = "127.0.0.1";
|
||||
|
||||
|
||||
@@ -707,7 +707,7 @@ extern "C" RENDERDOC_API TargetControl *RENDERDOC_CC RENDERDOC_CreateTargetContr
|
||||
|
||||
bool android = false;
|
||||
|
||||
if(!strncmp(host, "adb:", 4))
|
||||
if(host != NULL && !strncmp(host, "adb:", 4))
|
||||
{
|
||||
android = true;
|
||||
s = "127.0.0.1";
|
||||
|
||||
@@ -477,7 +477,7 @@ extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_EnumerateRemoteTargets(
|
||||
if(host != NULL && host[0] != '\0')
|
||||
s = host;
|
||||
|
||||
if(!strncmp(host, "adb:", 4))
|
||||
if(host != NULL && !strncmp(host, "adb:", 4))
|
||||
{
|
||||
s = "127.0.0.1";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user