MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / fixupLength

Function fixupLength

src/remote/protocol.cpp:128–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127
128inline 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

Callers 3

xdr_protocolFunction · 0.85
xdr_cstring_with_limitFunction · 0.85
xdr_longsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected