| 126 | |
| 127 | |
| 128 | inline void fixupLength(const RemoteXdr* xdrs, ULONG& length) |
| 129 | { |
| 130 | // If the short (16-bit) value >= 32KB is being transmitted, |
| 131 | // it gets expanded to long (32-bit) with a sign bit propagated. |
| 132 | // In order to avoid troubles when reading such a value as long, |
| 133 | // let's detect and fix unexpected overflows. Here we assume |
| 134 | // that real longs will never have the highest 16 bits set. |
| 135 | |
| 136 | if (xdrs->x_op == XDR_DECODE && length >> 16 == (ULONG) 0xFFFF) |
| 137 | length &= (ULONG) 0xFFFF; |
| 138 | } |
| 139 | |
| 140 | |
| 141 | #ifdef DEBUG |
no outgoing calls
no test coverage detected