www.libssh2.org | Daily snapshots | Mailing list archive | Docs | Examples

Archive Index This month's Index

Subject: Re: [libssh2] All Your Mem Belongs to Us

Re: [libssh2] All Your Mem Belongs to Us

From: James Housley <jim_at_thehousleys.net>
Date: Fri, 10 Nov 2006 08:23:42 -0500

On Nov 10, 2006, at 8:09 AM, Daniel Stenberg wrote:

> On Fri, 10 Nov 2006, James Housley wrote:
>
>> Looking at the code it seems the same should be applied between
>> lines 767/768, do you agree?
>
> Oh yes, good spotting!
>
> I guess the '35000' value is also nicer as a define with a nice name.

Okay. So does this look better?

+
+ /* RFC4253 section 6.1 Maximum Packet Length says:
+
+ "All implementations MUST be able to process
packets with
+ uncompressed payload length of 32768 bytes or
less and
+ total packet size of 35000 bytes or less
(including length,
+ padding length, payload, padding, and MAC.)."
+
+ */
+ if(packet_length > THE_DANIEL_STENBERG_CONSTANT) {
+ return -1;
+ }
+

Maybe that name needs a little work.

Maybe MAX_SSH_PACKET_LEN would be better.

Jim

--
/"\   ASCII Ribbon Campaign  .
\ / - NO HTML/RTF in e-mail  .
  X  - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
jeh@FreeBSD.org      http://www.FreeBSD.org     The Power to Serve
jim@TheHousleys.Net  http://www.TheHousleys.net
---------------------------------------------------------------------
"Eagles may soar, but weasels don't get sucked into jet engines"
     -- Anon
Received on 2006-11-10

the libssh2 team