fix more memory safety issues

This commit is contained in:
Nick Chan committed 2023-01-30 22:16:15 +08:00
1 parent 851d1d1df8
commit ab5ce9fd7e
2 files changed
+7 -7

No files matched your search

+3 -3
View File
@@ -44,9 +44,9 @@ void exec_checkra1n() {
unlink(checkra1n_path);
}
char args[0x10] = "-pE";
if (demote) strncat(args, "d", 0x10);
if (verbose >= 2) strncat(args, "v", 0x10);
if (pongo_path != NULL) strncat(args, "k", 0x10); // keep this at last
if (demote) strncat(args, "d", 0xf);
if (verbose >= 2) strncat(args, "v", 0xf);
if (pongo_path != NULL) strncat(args, "k", 0xf); // keep this at last
pid_t pid;
char* checkra1n_argv[] = {
checkra1n_path,
+4 -4
View File
@@ -326,11 +326,11 @@ static void write_stdout(char *buf, uint32_t len)
int issue_pongo_command(usb_device_handle_t handle, char *command)
{
uint32_t outpos = 0;
uint32_t outlen = 0;
uint8_t in_progress = 1;
if (command == NULL) goto fetch_output;
uint32_t outpos = 0;
uint32_t outlen = 0;
int ret = USB_RET_SUCCESS;
uint8_t in_progress = 1;
if (command == NULL) goto fetch_output;
size_t len = strlen(command);
char command_buf[512];
char stdout_buf[0x2000];