diff options
Diffstat (limited to 'meta/packages/udev/files/fix-alignment.patch')
-rw-r--r-- | meta/packages/udev/files/fix-alignment.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/packages/udev/files/fix-alignment.patch b/meta/packages/udev/files/fix-alignment.patch new file mode 100644 index 0000000000..8c7b8b5ac5 --- /dev/null +++ b/meta/packages/udev/files/fix-alignment.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | diff --git a/udev_rules_parse.c b/udev_rules_parse.c | ||
2 | --- a/udev_rules_parse.c | ||
3 | +++ b/udev_rules_parse.c | ||
4 | @@ -241,6 +241,7 @@ static int add_to_rules(struct udev_rule | ||
5 | int valid; | ||
6 | char *linepos; | ||
7 | char *attr; | ||
8 | + size_t padding; | ||
9 | int retval; | ||
10 | |||
11 | /* get all the keys */ | ||
12 | @@ -506,6 +507,11 @@ static int add_to_rules(struct udev_rule | ||
13 | |||
14 | /* grow buffer and add rule */ | ||
15 | rule_size = sizeof(struct udev_rule) + rule->bufsize; | ||
16 | + padding = (sizeof(size_t) - rule_size % sizeof(size_t)) % sizeof(size_t); | ||
17 | + dbg("add %zi padding bytes", padding); | ||
18 | + rule_size += padding; | ||
19 | + rule->bufsize += padding; | ||
20 | + | ||
21 | rules->buf = realloc(rules->buf, rules->bufsize + rule_size); | ||
22 | if (!rules->buf) { | ||
23 | err("realloc failed"); | ||
24 | |||