mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
utags: add one null byte in the end of payload
This is propagation of the patch submitted under (CR) into DLKM utags driver Change-Id: Ia0321e9560f0afddd19f31326008da0714304afa Signed-off-by: Konstantin Makariev <hcv867@motorola.com> Reviewed-on: https://gerrit.mot.com/1243363 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Master Yoda Reviewed-by: Konstantin Makariev <kmakariev@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
f8c0af92e1
commit
d5a8697f1c
1 changed files with 3 additions and 3 deletions
|
|
@ -770,7 +770,7 @@ static struct utag *thaw_tags(size_t block_size, void *buf)
|
|||
}
|
||||
|
||||
if (cur->size != 0) {
|
||||
cur->payload = kzalloc(cur->size, GFP_KERNEL);
|
||||
cur->payload = kzalloc(cur->size + 1, GFP_KERNEL);
|
||||
if (!cur->payload)
|
||||
goto err_free;
|
||||
memcpy(cur->payload, frozen->payload, cur->size);
|
||||
|
|
@ -1061,7 +1061,7 @@ static int check_utag_range(char *tag, struct utag *head, char *data,
|
|||
}
|
||||
|
||||
/* make local copy of .range payload to tokenize */
|
||||
buf = ptr = kzalloc(range->size, GFP_KERNEL);
|
||||
buf = ptr = kzalloc(range->size + 1, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
@ -1106,7 +1106,7 @@ static int replace_first_utag(struct utag *head, char *name,
|
|||
return -EIO;
|
||||
}
|
||||
|
||||
utag->payload = kzalloc(size, GFP_KERNEL);
|
||||
utag->payload = kzalloc(size + 1, GFP_KERNEL);
|
||||
if (!utag->payload) {
|
||||
utag->payload = oldpayload;
|
||||
return -EIO;
|
||||
|
|
|
|||
Loading…
Reference in a new issue