Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.12 KB | None | 0 0
  1. ==5959== Conditional jump or move depends on uninitialised value(s)
  2. ==5959==    at 0x442AEA3: ??? (in /lib/libc-2.12.2.so)
  3. ==5959==    by 0x80960B1: NewUser(char*, char*, int) (udp.cc:62)
  4. ==5959==    by 0x805026A: ReadConfig(char*) (main.cc:1151)
  5. ==5959==    by 0x80520E8: main (main.cc:1694)
  6. ==5959==  Uninitialised value was created by a stack allocation
  7. ==5959==    at 0x804DD0B: ReadConfig(char*) (main.cc:595)
  8.  
  9. udp.cc
  10.  
  11. void NewUser(char *user, char *pass, int level)
  12. {
  13.         USERLIST *new_user;
  14.         USERLIST *global = UDPUserList;
  15.  
  16.         new_user = new(USERLIST);
  17.  
  18.         new_user->user = strdup(user);
  19.         new_user->pass = strdup(pass);
  20.         new_user->level = level;
  21.         new_user->next = NULL;
  22.  
  23.         if (!UDPUserList)
  24.         {
  25.                 UDPUserList = new_user;
  26.                 return;
  27.         }
  28.  
  29.  
  30. main.cc
  31.  
  32.                 } else if (!strcasecmp(label, "UDPUSER"))
  33.                 {
  34. #ifdef UDP
  35.         if (true) {
  36.             ulvl = 0;
  37.                         udppass = strstr(value,",");
  38.                         if (udppass)
  39.                         {
  40.                             udppass[0] = '\0';
  41.                                 udppass++;
  42.                         }
  43.                         udplvl = strstr(udppass,"=");
  44.                         if (udplvl)
  45.                         {
  46.                            udplvl[0] = '\0';
  47.                                udplvl++;
  48.                                ulvl = atoi(udplvl);
  49.                         }
  50.                         if (strlen(value) && udppass && ulvl)
  51.                         {
  52.                             NewUser(value,udppass,ulvl);
  53.                         }
  54.                 }
  55.                 // reset variables...
  56.                 strcpy(value, "");
  57.                 udppass = NULL;
  58.                 ulvl = 0;
  59. #endif
  60.                                         } else {
  61.                                                 printf("unknown label '%s' in configfile.\n", label);
  62.                                                 fclose(in_file);
  63.                                                 return (FALSE);
  64.                                         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement