aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-serialize.c
diff options
context:
space:
mode:
Diffstat (limited to 'libctf/ctf-serialize.c')
-rw-r--r--libctf/ctf-serialize.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libctf/ctf-serialize.c b/libctf/ctf-serialize.c
index 0811b7b..9f50280 100644
--- a/libctf/ctf-serialize.c
+++ b/libctf/ctf-serialize.c
@@ -849,7 +849,9 @@ ctf_emit_type_sect (ctf_dict_t *fp, unsigned char **tptr)
break;
case CTF_K_FUNCTION:
- memcpy (t, dtd->dtd_vlen, sizeof (uint32_t) * (vlen + (vlen & 1)));
+ /* Functions with no args also have no vlen. */
+ if (dtd->dtd_vlen)
+ memcpy (t, dtd->dtd_vlen, sizeof (uint32_t) * (vlen + (vlen & 1)));
t += sizeof (uint32_t) * (vlen + (vlen & 1));
break;