Commit 6298bf90 authored by Richard Levitte's avatar Richard Levitte
Browse files

There is a chance that the input string is larger than size, and on VMS,

this wasn't checked and could possibly be exploitable (slim chance, but still)
parent 9a26adf5
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -310,10 +310,17 @@ void program_name(char *in, char *out, int size)

	q=strrchr(p,'.');
	if (q == NULL)
		q = in+size;
	strncpy(out,p,q-p);
		q = p + strlen(p);
	strncpy(out,p,size-1);
	if (q-p >= size)
		{
		out[size-1]='\0';
		}
	else
		{
		out[q-p]='\0';
		}
	}
#else
void program_name(char *in, char *out, int size)
	{