Wed Feb 14 00:21:17 1996 David Mosberger-Tang <davidm@azstarnet.com>
authorroland <roland>
Tue, 19 Mar 1996 19:53:31 +0000 (19:53 +0000)
committerroland <roland>
Tue, 19 Mar 1996 19:53:31 +0000 (19:53 +0000)
* sunrpc/rpc_cmsg.c (xdr_callmsg, svc_authux.c): increment "buf"
  pointer by casting it to a char* first since a long* may be 8
  bytes or more and oa->oa_length may be any multiple of 4.

sunrpc/rpc_cmsg.c

index d9d815a..a4d5ef3 100644 (file)
@@ -82,7 +82,7 @@ xdr_callmsg(xdrs, cmsg)
                        IXDR_PUT_LONG(buf, oa->oa_length);
                        if (oa->oa_length) {
                                bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
-                               buf += RNDUP(oa->oa_length) / sizeof (long);
+                               buf = (long *) ((char *) buf + RNDUP(oa->oa_length));
                        }
                        oa = &cmsg->rm_call.cb_verf;
                        IXDR_PUT_ENUM(buf, oa->oa_flavor);
@@ -90,7 +90,7 @@ xdr_callmsg(xdrs, cmsg)
                        if (oa->oa_length) {
                                bcopy(oa->oa_base, (caddr_t)buf, oa->oa_length);
                                /* no real need....
-                               buf += RNDUP(oa->oa_length) / sizeof (long);
+                               buf = (long *) ((char *) buf + RNDUP(oa->oa_length));
                                */
                        }
                        return (TRUE);
@@ -132,8 +132,8 @@ xdr_callmsg(xdrs, cmsg)
                                        bcopy((caddr_t)buf, oa->oa_base,
                                            oa->oa_length);
                                        /* no real need....
-                                       buf += RNDUP(oa->oa_length) /
-                                               sizeof (long);
+                                       buf = (long *) ((char *) buf
+                                             + RNDUP(oa->oa_length));
                                        */
                                }
                        }
@@ -166,8 +166,8 @@ xdr_callmsg(xdrs, cmsg)
                                        bcopy((caddr_t)buf, oa->oa_base,
                                            oa->oa_length);
                                        /* no real need...
-                                       buf += RNDUP(oa->oa_length) /
-                                               sizeof (long);
+                                       buf = (long *) ((char *) buf
+                                             + RNDUP(oa->oa_length));
                                        */
                                }
                        }