Use load_32_be processing length in TCP reply
authorKen Raeburn <raeburn@mit.edu>
Fri, 21 Aug 2009 18:32:53 +0000 (18:32 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 21 Aug 2009 18:32:53 +0000 (18:32 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22570 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/os/sendto_kdc.c

index 5fc39538190bf79f3ff55d322a563daf6554967a..dcf08d996be45d9c907542659976118b9b409c1b 100644 (file)
@@ -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) {