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

Collapse All | Expand All

(-)file_not_specified_in_diff (-4 / +17 lines)
Line  Link Here
0
-- code/botlib/be_ai_chat.c
0
++ code/botlib/be_ai_chat.c
Lines 367-379 Link Here
367
int BotNextConsoleMessage(int chatstate, bot_consolemessage_t *cm)
367
int BotNextConsoleMessage(int chatstate, bot_consolemessage_t *cm)
368
{
368
{
369
	bot_chatstate_t *cs;
369
	bot_chatstate_t *cs;
370
	bot_consolemessage_t *firstmsg;
370
371
371
	cs = BotChatStateFromHandle(chatstate);
372
	cs = BotChatStateFromHandle(chatstate);
372
	if (!cs) return 0;
373
	if (!cs) return 0;
373
	if (cs->firstmessage)
374
	if ((firstmsg = cs->firstmessage))
374
	{
375
	{
375
		Com_Memcpy(cm, cs->firstmessage, sizeof(bot_consolemessage_t));
376
		cm->handle = firstmsg->handle;
376
		cm->next = cm->prev = NULL;
377
		cm->time = firstmsg->time;
378
		cm->type = firstmsg->type;
379
		Q_strncpyz(cm->message, firstmsg->message,
380
			   sizeof(cm->message));
381
		
382
		/* We omit setting the two pointers in cm because pointer
383
		 * size in the VM differs between the size in the engine on
384
		 * 64 bit machines, which would lead to a buffer overflow if
385
		 * this functions is called from the VM. The pointers are
386
		 * of no interest to functions calling
387
		 * BotNextConsoleMessage anyways.
388
		 */
389
		
377
		return cm->handle;
390
		return cm->handle;
378
	} //end if
391
	} //end if
379
	return 0;
392
	return 0;

Return to bug 173015