diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2008-01-24 11:14:20 -0800 |
---|---|---|
committer | Jorge Lucangeli Obes <jorgelo@google.com> | 2015-09-03 14:13:03 -0700 |
commit | c2a25909b2c4d989e49cdedcac4dd52c45f0570b (patch) | |
tree | a28ef5734c4b09953567398ff90ce4bfce8015d1 /libcap/libcap.h | |
parent | 973e826b0e6a4c9802a10140142f9532a592e8fa (diff) | |
download | libcap-c2a25909b2c4d989e49cdedcac4dd52c45f0570b.tar.gz |
Fix malloc(size) but in capsh and numeric capabilities (for unnamed bits)
capsh allocated too little memory for the --inh argument - led to glibc
aborting with free().
libcap has always had latent support for identifying unnamed capabilities
with integers. It was untested (and therefore broken) prior to this commit.
Should be fixed now.
Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
Diffstat (limited to 'libcap/libcap.h')
-rw-r--r-- | libcap/libcap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libcap/libcap.h b/libcap/libcap.h index 854f907..bd22397 100644 --- a/libcap/libcap.h +++ b/libcap/libcap.h @@ -98,6 +98,9 @@ struct _cap_struct { } u[_LINUX_CAPABILITY_U32S]; }; +/* the maximum bits supportable */ +#define __CAP_MAXBITS (__CAP_BLKS * 32) + /* string magic for cap_free */ #define CAP_S_MAGIC 0xCA95D0 |