Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    November 2017
    Posts
    13

    Question crash crash brrr

    Code: https://hastebin.com/ivowepiteb.m
    Crash: "The thread tried to read from or write to a virtual adress for which it does not have the appropriate access.
    Using: Visual Studio 2017
    DLL: x64 Release
    Client causes crash: https://prnt.sc/ph49ov
    Client not causing crash & displaying information properly: https://prnt.sc/ph49pl
    API version: 23 (3.3.2)


    I don't get it why it does crash with SOME clients. PLEASE HELP ME OUT !
    And another question: How do I get the channel ID and the client ID ?

  2. #2
    Join Date
    February 2017
    Location
    Kepler-186f
    Posts
    69
    You need to free the memory.
    Last edited by cydolo; October 14th, 2019 at 04:16 PM.

  3. #3
    Join Date
    November 2017
    Posts
    13
    I did this with all char* defined above but it does cause a crash to me if I click on myself

    part of code: https://hastebin.com/tedotopina.cpp

  4. #4
    Join Date
    February 2017
    Location
    Kepler-186f
    Posts
    69
    I do not know from where you get the buffersize 1048576
    Last edited by cydolo; October 14th, 2019 at 04:16 PM.

  5. #5
    Join Date
    November 2017
    Posts
    13
    Code: https://hastebin.com/apuwugeyep.m

    If I click on any channel I crash.
    And sometimes I crash if I click on clients.

  6. #6
    Join Date
    February 2017
    Location
    Kepler-186f
    Posts
    69
    you need to free the memory after snprintf.
    the reason why you crashed is because you are trying to free the memory that not has been written.
    Code:
    char* channelId = "Error";
    Last edited by cydolo; October 14th, 2019 at 04:17 PM.

  7. #7
    Join Date
    February 2017
    Location
    Kepler-186f
    Posts
    69
    I did that without your code. it works for me without any errors or crashes.

    https://hastebin.com/iwunosaqim.m
    Code:
    void ts3plugin_infoData(uint64 serverConnectionHandlerID, uint64 id, enum PluginItemType type, char** data) {
    	char* channel_name;
    	char* client_name;
    	char* client_uuid;
    	char* client_totalcon;
    	char* client_dbid;
    
    	/* For demonstration purpose, display the name of the currently selected server, channel or client. */
    	switch (type) {
    	case PLUGIN_SERVER: return;
    	case PLUGIN_CHANNEL:
    		if (ts3Functions.getChannelVariableAsString(serverConnectionHandlerID, id, CHANNEL_NAME, &channel_name) != ERROR_ok) {
    			printf("Error getting channel name\n");
    			return;
    		}
    		*data = (char*)malloc(INFODATA_BUFSIZE * sizeof(char));
    		snprintf(*data, INFODATA_BUFSIZE, "Name: %s\nID: %u", channel_name, id);
    		ts3Functions.freeMemory(channel_name);
    		return;
    	case PLUGIN_CLIENT:
    		if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_NICKNAME, &client_name) != ERROR_ok) { printf("Error getting client nickname\n"); return; }
    		if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_UNIQUE_IDENTIFIER, &client_uuid) != ERROR_ok) { printf("Error getting client uuid\n"); return; }
    		if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_TOTALCONNECTIONS, &client_totalcon) != ERROR_ok) { printf("Error getting client totalconnections\n"); return; }
    		if (ts3Functions.getClientVariableAsString(serverConnectionHandlerID, (anyID)id, CLIENT_DATABASE_ID, &client_dbid) != ERROR_ok) { printf("Error getting client database\n"); return; }
    
    		
    		*data = (char*)malloc(INFODATA_BUFSIZE * sizeof(char));
    		snprintf(*data, INFODATA_BUFSIZE, "Name: %s\nID: %u\nUUID: %s\nDatabaseid: %s\nTotalconnections: %s", client_name, id, client_uuid, client_dbid, client_totalcon);
    		ts3Functions.freeMemory(client_name);
    		ts3Functions.freeMemory(client_uuid);
    		ts3Functions.freeMemory(client_totalcon);
    		ts3Functions.freeMemory(client_dbid);
    		return;
    	default:
    		printf("Invalid item type: %d\n", type);
    		data = NULL;  /* Ignore */
    		return;
    	}
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [Resolved] teamspeak 3 application android crash crash crash
    By hycksou in forum Android
    Replies: 4
    Last Post: July 5th, 2017, 07:05 PM
  2. Crash after log in
    By cluster04 in forum Windows
    Replies: 0
    Last Post: February 23rd, 2017, 08:01 PM
  3. [Resolved] Users can crash all per crash
    By VinzK in forum Bug Reports [EN/DE]
    Replies: 34
    Last Post: April 26th, 2016, 03:47 PM
  4. Replies: 0
    Last Post: November 18th, 2014, 10:40 PM
  5. Replies: 11
    Last Post: April 19th, 2010, 12:51 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •