mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
protocol-native: fix out-of-bounds access to SEC_LABEL hex table
If buffer type char[] is 4-byte aligned, higher 3-byte on char could be non-zero if data is not initialized, which make 'buffer[i] >> 4' larger than 0x0f. Use type uint8_t[] on SEC_LABEL buffer to fix it.
This commit is contained in:
parent
471fffe4a3
commit
3bce026d67
1 changed files with 2 additions and 2 deletions
|
|
@ -391,7 +391,7 @@ static const struct pw_protocol_native_connection_events server_conn_events = {
|
|||
.need_flush = on_server_need_flush,
|
||||
};
|
||||
|
||||
static bool check_print(const char *buffer, int len)
|
||||
static bool check_print(const uint8_t *buffer, int len)
|
||||
{
|
||||
int i;
|
||||
while (len > 1 && buffer[len-1] == 0)
|
||||
|
|
@ -414,7 +414,7 @@ static struct client_data *client_new(struct server *s, int fd)
|
|||
#endif
|
||||
struct pw_context *context = protocol->context;
|
||||
struct pw_properties *props;
|
||||
char buffer[1024];
|
||||
uint8_t buffer[1024];
|
||||
struct protocol_data *d = pw_protocol_get_user_data(protocol);
|
||||
int i, res;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue