From 2933a59feb611ddf25145c6e8b52b89e15681789 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 21 Aug 2009 18:32:53 +0000 Subject: [PATCH] Use load_32_be processing length in TCP reply git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22570 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/sendto_kdc.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/krb5/os/sendto_kdc.c b/src/lib/krb5/os/sendto_kdc.c index 5fc395381..dcf08d996 100644 --- a/src/lib/krb5/os/sendto_kdc.c +++ b/src/lib/krb5/os/sendto_kdc.c @@ -1017,11 +1017,7 @@ service_tcp_fd (struct conn_state *conn, struct select_state *selstate, } conn->x.in.bufsizebytes_read += nread; if (conn->x.in.bufsizebytes_read == 4) { - unsigned long len; - len = conn->x.in.bufsizebytes[0]; - len = (len << 8) + conn->x.in.bufsizebytes[1]; - len = (len << 8) + conn->x.in.bufsizebytes[2]; - len = (len << 8) + conn->x.in.bufsizebytes[3]; + unsigned long len = load_32_be (conn->x.in.bufsizebytes); dprint("received length on fd %d is %d\n", conn->fd, (int)len); /* Arbitrary 1M cap. */ if (len > 1 * 1024 * 1024) { -- 2.26.2