Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 83596 | Differences between
and this patch

Collapse All | Expand All

(-)telnet.c (+9 lines)
Lines 1326-1331 Link Here
1326
}
1326
}
1327
1327
1328
unsigned char slc_reply[128];
1328
unsigned char slc_reply[128];
1329
unsigned char const * const slc_reply_eom = &slc_reply[sizeof(slc_reply)];
1329
unsigned char *slc_replyp;
1330
unsigned char *slc_replyp;
1330
1331
1331
void
1332
void
Lines 1341-1346 Link Here
1341
void
1342
void
1342
slc_add_reply(unsigned char func, unsigned char flags, cc_t value)
1343
slc_add_reply(unsigned char func, unsigned char flags, cc_t value)
1343
{
1344
{
1345
	/* A sequence of up to 6 bytes my be written for this member of the SLC
1346
	 * suboption list by this function.  The end of negotiation command,
1347
	 * which is written by slc_end_reply(), will require 2 additional
1348
	 * bytes.  Do not proceed unless there is sufficient space for these
1349
	 * items.
1350
	 */
1351
	if (&slc_replyp[6+2] > slc_reply_eom)
1352
		return;
1344
	if ((*slc_replyp++ = func) == IAC)
1353
	if ((*slc_replyp++ = func) == IAC)
1345
		*slc_replyp++ = IAC;
1354
		*slc_replyp++ = IAC;
1346
	if ((*slc_replyp++ = flags) == IAC)
1355
	if ((*slc_replyp++ = flags) == IAC)

Return to bug 83596