]>
git.proxmox.com Git - mirror_corosync-qdevice.git/commitdiff
projects
/
mirror_corosync-qdevice.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3469f01
)
tlv: Check dynar_cat result
author
Jan Friesse
<jfriesse@redhat.com>
Wed, 4 Nov 2020 16:46:38 +0000
(17:46 +0100)
committer
Jan Friesse
<jfriesse@redhat.com>
Wed, 4 Nov 2020 16:52:04 +0000
(17:52 +0100)
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
qdevices/tlv.c
patch
|
blob
|
blame
|
history
diff --git
a/qdevices/tlv.c
b/qdevices/tlv.c
index beabd177de536a4a25fb0ee98698abb0a307a5c8..c741359b4c58838c8e5aec534d3646622a949821 100644
(file)
--- a/
qdevices/tlv.c
+++ b/
qdevices/tlv.c
@@
-98,9
+98,17
@@
tlv_add(struct dynar *msg, enum tlv_opt_type opt_type, uint16_t opt_len, const v
nopt_type = htons((uint16_t)opt_type);
nlen = htons(opt_len);
- dynar_cat(msg, &nopt_type, sizeof(nopt_type));
- dynar_cat(msg, &nlen, sizeof(nlen));
- dynar_cat(msg, value, opt_len);
+ if (dynar_cat(msg, &nopt_type, sizeof(nopt_type)) == -1) {
+ return (-1);
+ }
+
+ if (dynar_cat(msg, &nlen, sizeof(nlen)) == -1) {
+ return (-1);
+ }
+
+ if (dynar_cat(msg, value, opt_len) == -1) {
+ return (-1);
+ }
return (0);
}