Merge pull request #24 from ericchu94/master

Fix buffer overflow due to null character
This commit is contained in:
Aurora 2016-04-15 19:32:10 +02:00
commit b4cd67cb8c

View File

@ -76,14 +76,14 @@ int main(int argc, char **argv)
error(payload, "Pattern not found");
}
u8 input[37] = {0};
u8 payloadname[2 * sizeof(input)] = {0};
u8 input[38] = {0};
u8 payloadname[2 * (sizeof(input) - 1)] = {0};
printf("Enter the payload's path (37 characters max): ");
scanf("%37s", input);
unsigned int i;
for (i = 0; i < sizeof(input); i++)
for (i = 0; i < sizeof(input) - 1; i++)
payloadname[2 * i] = input[i];
memcpy(found + 12, payloadname, sizeof(payloadname));