Skip to content

Commit 83032c5

Browse files
committed
add length check
it seems like the strncpy is clobbering something man i don't have c down
1 parent 9629cc3 commit 83032c5

File tree

1 file changed

+5
-0
lines changed
  • goldhen_plugins/plugin_src/extern_traces/source

1 file changed

+5
-0
lines changed

goldhen_plugins/plugin_src/extern_traces/source/logging.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ long sceKernelWrite(int, const void *, unsigned long);
109109
void extern_logf(const char *msg)
110110
{
111111
int len = strlen(msg);
112+
if (logging_state.buffer_idx + len >= MAX_BUFFERED_BYTES) {
113+
printf("extern_traces: extern_logf dropping logs\n");
114+
return;
115+
}
116+
112117
strncpy(&logging_state.buffer[logging_state.buffer_idx], msg, len);
113118
logging_state.buffer_idx += len;
114119

0 commit comments

Comments
 (0)