[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lost] [Patch] file: Fixes beim Umschreiben des Pfads
Ups, jetzt aber...
Index: src/modules/init/io.c
===================================================================
--- src/modules/init/io.c (Revision 718)
+++ src/modules/init/io.c (Arbeitskopie)
@@ -90,14 +90,15 @@
{
byte* attr = (byte*) data;
char* path = (char*) ((dword) data + 1);
- size_t path_length = strnlen(path, data_size);
+ size_t path_length = strnlen(path, data_size - 1);
char* service_name = NULL;
io_resource_t* pipe_source = NULL;
int i, last_pipe;
pid_t last_pid = pid;
//printf("[ INIT ] rpc_io_open: path='%s', attr='%x'\n", path, *attr);
- if (path_length >= data_size) {
+ // Pruefen, ob der Pfad nullterminiert ist
+ if (path_length >= data_size - 1) {
rpc_send_response(pid, correlation_id, 0, NULL);
return;
}