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
3238ba0e2f
commit
d9fc432872
1 changed files with 5 additions and 5 deletions
|
|
@ -1107,12 +1107,12 @@ static int metadata_property(void *data,
|
||||||
|
|
||||||
e->subject = subject;
|
e->subject = subject;
|
||||||
e->key = SPA_PTROFF(e, sizeof(*e), void);
|
e->key = SPA_PTROFF(e, sizeof(*e), void);
|
||||||
strcpy(e->key, key);
|
memcpy(e->key, key, strlen(key) + 1);
|
||||||
e->value = SPA_PTROFF(e->key, strlen(e->key) + 1, void);
|
e->value = SPA_PTROFF(e->key, strlen(key) + 1, void);
|
||||||
strcpy(e->value, value);
|
memcpy(e->value, value, strlen(value) + 1);
|
||||||
if (type) {
|
if (type) {
|
||||||
e->type = SPA_PTROFF(e->value, strlen(e->value) + 1, void);
|
e->type = SPA_PTROFF(e->value, strlen(value) + 1, void);
|
||||||
strcpy(e->type, type);
|
memcpy(e->type, type, strlen(type) + 1);
|
||||||
} else {
|
} else {
|
||||||
e->type = NULL;
|
e->type = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue