Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Null pointer dereference #6

@ariccio

Description

@ariccio

I'm screwing around with /analyze, and it's picked up a couple of issues for AppJailLauncher. This may cause crashes.

At lines 52, 53, and 57, in utils.cpp, you're dereferencing a pointer that might be NULL.

Pointer p is declared struct addrinfo *p = NULL, and assigned to in the for loop:

for (p = servinfo; p != NULL; p = p->ai_next) {

If the loop terminates because p == NULL, then you're dereferencing a NULL pointer here:

	LOG(
		"Socket bound on %s:%i\n",
		InetNtop(
			p->ai_family,
			(PVOID) &((struct sockaddr_in *) p->ai_addr)->sin_addr,
			szAddr,
			sizeof(szAddr) / sizeof(_TCHAR)
			),
		htons(((struct sockaddr_in *) p->ai_addr)->sin_port)
		);

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions