[Verse-dev] v_unpack_connect_accept and address

Emil Brink verse-dev@blender.org
Thu, 1 Jul 2004 14:52:40 +0200 (MEST)


Eskil,

The code for the above-mentioned function, in v_man_pack_node.c, does
not touch the "address" variable before passing it to the client:

unsigned int v_unpack_connect_accept(const char *buf, unsigned int buffer_length)
{
	unsigned int buffer_pos = 0;
	VSession (* func_connect_accept)(void *user_data, VNodeID avatar, char *address);
	VNodeID avatar;
	char *address;
	func_connect_accept = v_fs_get_user_func(1);
	if(buffer_length < 4)
		return -1;
	buffer_pos += vnp_raw_unpack_uint32(&buf[buffer_pos], &avatar);
	#if defined(V_PRINT_RECIVE_COMMANDS)
	printf("receive: verse_send_connect_accept(avatar = %u ); callback = %p\n", avatar, user_func);
	#endif
	if(func_connect_accept != NULL)
		func_connect_accept(v_fs_get_user_data(1), avatar, address);

	return buffer_pos;
}

This crashes my client that simply tries to printf() the address
(it's 0x10, which is out of bounds).

Is there some code missing, here?

/Emil