Merge pull request from WGH-

This commit is contained in:
frekky 2016-08-05 20:38:22 +08:00
commit cf38506dd9
2 changed files with 3 additions and 3 deletions

View File

@ -27,7 +27,6 @@
#include <ctype.h>
#include <fcntl.h>
#include <time.h>
#include <arpa/inet.h>
#ifdef WINDOWS32
#include "windows.h"
@ -36,6 +35,7 @@
#include <grp.h>
#include <pwd.h>
#include <netdb.h>
#include <arpa/inet.h>
#endif
#include "common.h"

View File

@ -1532,7 +1532,7 @@ handle_dns_login(int dns_fd, struct query *q, uint8_t *domain, int domain_len, i
tcp_forward_error:
DEBUG(1, "Failed to connect TCP forward for user %d: %s", userid, errormsg);
out[0] = 'E';
strncat(out + 1, errormsg, sizeof(out) - 1);
strncpy(out + 1, errormsg, sizeof(out) - 1);
read = strlen(out);
write_dns(dns_fd, q, out, read + 1, u->downenc);
}
@ -1854,7 +1854,7 @@ handle_null_request(int dns_fd, struct query *q, int domain_len)
{
char cmd, userchar;
int userid = -1;
uint8_t in[QUERY_NAME_SIZE];
uint8_t in[QUERY_NAME_SIZE + 1];
/* Everything here needs at least 5 chars in the name:
* cmd, userid and more data or at least 3 bytes CMC */