made noOutput safer

it's now returning empty key of *VALID* keyLength
This commit is contained in:
Václav Šmejkal 2022-06-19 16:20:52 +02:00
parent f3c11a46c6
commit 0a0803145c
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -19,10 +19,15 @@ inputFlags noFlags()
outputFlags noOutput(unsigned char exitCode) outputFlags noOutput(unsigned char exitCode)
{ {
char *empty1 = malloc(1); char *empty1 = malloc(1); //TEXT
char *empty2 = malloc(1);
empty1[0] = '\0'; empty1[0] = '\0';
empty2[0] = '\0';
char *empty2 = malloc(getKeyLength() + 1); //KEY
for (int i = 0; i < getKeyLength(); i++)
{
empty2[i] = 'x';
}
empty2[getKeyLength()] = '\0';
return (outputFlags) { empty1, empty2, 0, 0, exitCode }; return (outputFlags) { empty1, empty2, 0, 0, exitCode };
} }