aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2014-02-21 14:04:34 +0000
committerDavid Howells <dhowells@redhat.com>2014-02-21 14:17:27 +0000
commit50e25867fd567a18a4fd972c97108c14745962e2 (patch)
treecc9f6ec018f813c99acf1f1629e5de07a21a8416
parent00feb366f80b2a56d5941092c697f924c61f056f (diff)
downloadkeyutils-50e25867fd567a18a4fd972c97108c14745962e2.tar.gz
Revert "Lib: Check the description string is NUL-terminated when retrieved"
This reverts commit ed72a1dfc56a4f5428affb1659d6812d54e392c5. The problem is that the buffer argument might validly be NULL, leading to a SEGV when we try to check for the NUL termination. Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r--keyutils.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/keyutils.c b/keyutils.c
index 96901c1..8856c8a 100644
--- a/keyutils.c
+++ b/keyutils.c
@@ -110,11 +110,7 @@ long keyctl_setperm(key_serial_t id, key_perm_t perm)
long keyctl_describe(key_serial_t id, char *buffer, size_t buflen)
{
- long ret = keyctl(KEYCTL_DESCRIBE, id, buffer, buflen);
-
- if (ret == 0 || (ret > 0 && !buffer[ret - 1]))
- abort();
- return ret;
+ return keyctl(KEYCTL_DESCRIBE, id, buffer, buflen);
}
long keyctl_clear(key_serial_t ringid)