diff --git a/console/rzlib/rzlib.c b/console/rzlib/rzlib.c index 71c46dcdb9..c8257f2773 100644 --- a/console/rzlib/rzlib.c +++ b/console/rzlib/rzlib.c @@ -2076,8 +2076,8 @@ const char* gzerror (voidp file, int *errnum) free(s->msg); s->msg = (char*)malloc(strlen(s->path) + strlen(m) + 3); strlcpy(s->msg, s->path, sizeof(s->msg)); - strcat(s->msg, ": "); - strcat(s->msg, m); + strlcat(s->msg, ": ", sizeof(s->msg)); + strlcat(s->msg, m, sizeof(s->msg)); return (const char*)s->msg; } diff --git a/xenon/main.c b/xenon/main.c index 8c4e9fae4a..5cb606220d 100644 --- a/xenon/main.c +++ b/xenon/main.c @@ -31,6 +31,7 @@ #include #include #include +#include "../compat/strl.h" #undef main @@ -100,8 +101,8 @@ static void append_dir_to_path(char *path, const char *dir) return; else { - strcat(path, dir); - strcat(path, "/"); + strlcat(path, dir, sizeof(path)); + strlcat(path, "/", sizeof(path)); } } @@ -128,7 +129,7 @@ int main(void) return 0; strlcpy(path, s, sizeof(path)); - strcat(path, ":/"); + strlcat(path, ":/", sizeof(path)); load_dir(path); @@ -164,7 +165,7 @@ int main(void) { char fn[256]; strlcpy(fn, path, sizeof(fn)); - strcat(fn, entries[pos].d_name); + strlcat(fn, entries[pos].d_name, sizeof(fn)); printf("%s\n", fn); @@ -188,7 +189,7 @@ int main(void) } while (handle < 0); strlcpy(path, s, sizeof(path)); - strcat(path, ":/"); + strlcat(path, ":/", sizeof(path)); load_dir(path); ppos = -1; pos = 0;