mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-06 01:11:46 +00:00
Reduce the maximum LOG session string length
The maximum possible string length is defined by the platform with the lowest maximum IPC payload size (currently OKL4). Fixes #1919
This commit is contained in:
parent
a1239c5e9d
commit
146c694513
@ -28,7 +28,10 @@ struct Genode::Log_session : Session
|
|||||||
|
|
||||||
virtual ~Log_session() { }
|
virtual ~Log_session() { }
|
||||||
|
|
||||||
typedef Rpc_in_buffer<256> String;
|
/* the lowest platform-specific maximum IPC payload size (OKL4) */
|
||||||
|
enum { MAX_STRING_LEN = 236};
|
||||||
|
|
||||||
|
typedef Rpc_in_buffer<MAX_STRING_LEN> String;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output null-terminated string
|
* Output null-terminated string
|
||||||
|
@ -27,7 +27,7 @@ class Log_console : public Console
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum { _BUF_SIZE = 216 };
|
enum { _BUF_SIZE = Log_session::MAX_STRING_LEN };
|
||||||
|
|
||||||
Log_connection _log;
|
Log_connection _log;
|
||||||
char _buf[_BUF_SIZE];
|
char _buf[_BUF_SIZE];
|
||||||
|
@ -47,7 +47,7 @@ class Vfs::Log_file_system : public Single_file_system
|
|||||||
|
|
||||||
/* count does not include the trailing '\0' */
|
/* count does not include the trailing '\0' */
|
||||||
while (count > 0) {
|
while (count > 0) {
|
||||||
char tmp[256];
|
char tmp[Genode::Log_session::MAX_STRING_LEN];
|
||||||
int const curr_count = min(count, sizeof(tmp) - 1);
|
int const curr_count = min(count, sizeof(tmp) - 1);
|
||||||
memcpy(tmp, src, curr_count);
|
memcpy(tmp, src, curr_count);
|
||||||
tmp[curr_count > 0 ? curr_count : 0] = 0;
|
tmp[curr_count > 0 ? curr_count : 0] = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user