mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-04-28 06:46:42 -04:00
tools: replace strcpy with memcpy
Potential buffer overflow in metadata_property function when copying strings. Fixes buffer overflow issue in string copying.
This commit is contained in:
parent
b445e82bcb
commit
ee5505430e
1 changed files with 5 additions and 5 deletions
|
|
@ -1107,12 +1107,12 @@ static int metadata_property(void *data,
|
|||
|
||||
e->subject = subject;
|
||||
e->key = SPA_PTROFF(e, sizeof(*e), void);
|
||||
strcpy(e->key, key);
|
||||
e->value = SPA_PTROFF(e->key, strlen(e->key) + 1, void);
|
||||
strcpy(e->value, value);
|
||||
memcpy(e->key, key, strlen(key) + 1);
|
||||
e->value = SPA_PTROFF(e->key, strlen(key) + 1, void);
|
||||
memcpy(e->value, value, strlen(value) + 1);
|
||||
if (type) {
|
||||
e->type = SPA_PTROFF(e->value, strlen(e->value) + 1, void);
|
||||
strcpy(e->type, type);
|
||||
e->type = SPA_PTROFF(e->value, strlen(value) + 1, void);
|
||||
memcpy(e->type, type, strlen(type) + 1);
|
||||
} else {
|
||||
e->type = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue