(read_token): check malloc

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7926 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-02-12 21:31:38 +00:00
parent 6eb399502d
commit f8d313b2e0

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 1998, 1999 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -64,6 +64,8 @@ read_token (int sock, gss_buffer_t buf)
len = ntohl(net_len);
buf->length = len;
buf->value = malloc(len);
if (buf->value == NULL)
err (1, "malloc %u", len);
if (read (sock, buf->value, len) != len)
err (1, "read");
}