From: Adam O. <rh...@d2...> - 2001-10-17 11:48:19
|
On Wed, Oct 17, 2001 at 09:16:16AM +0000, Adam Olsen wrote: > There's a bug in Netchan_OutOfBandPrint, in which it uses strlen > instead of strlen + 1, causing the terminating nul to be stripped. > The client doesn't notice because it never bothers to check for short > reads with connectionless packets. And I checked, it's in the > original q1source. So the net result is that my modified > MSG_ReadString, which returns "" incase of error instead of a copied > string with termination added, is not able to parse connection > packets. > > It's not the end of the world though. I think I should be able to > leave CL_ConnectionlessPacket using a (renamed) version of the old > MSG_ReadString, and make the rest of the engine use my modified > MSG_ReadString. > > Hmm, or I could make it append a \0 to the buffer incase it's not > terminated, since I know that'd work in this case. I dunno how well > that'd work in general though. And it's kinda hacky. Well, I did the "append \0" method, because it means simpler code (no duplicate functions), and I don't have to pick and choose between two said functions. It seemed to work well initially, but after a bit of spectating on prozac I reconnected and got this: Fatal error: SZ_GetSpace: overflow without allowoverflow set (0) I realize now that calling MSG_WriteByte won't work in overflow situations, since I want it to tollerate overflows, but what concerns me more that maxsize is 0. I've no idea how it could get that, while still getting data in the firstplace: (gdb) p *buf $2 = {allowoverflow = false, overflowed = false, data = 0xbfffe7ac "ÿÿÿÿgetchallenge\n", maxsize = 0, cursize = 17} Any ideas? -- Adam Olsen, aka Rhamphoryncus |