Changes in trunk/src/sh_tools.c [18:30]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_tools.c
r18 r30 127 127 unsigned char c, d; 128 128 const char * p; 129 char *q;130 129 char tmp[4]; 131 130 char * outstr; … … 147 146 148 147 p = instr; 149 q = outstr;150 148 151 149 #if !defined(SH_USE_XML) … … 441 439 int DoReverseLookup = S_TRUE; 442 440 443 int set_reverse_lookup (c har * c)441 int set_reverse_lookup (const char * c) 444 442 { 445 443 return sh_util_flagval(c, &DoReverseLookup); … … 462 460 463 461 int retval; 462 size_t len; 464 463 465 464 sin_cache * check_cache = conn_cache; … … 535 534 else 536 535 { 537 host_name = SH_ALLOC(sl_strlen(host_entry->h_name) + 1);538 if (sl_strlen(host_entry->h_name) > 0)539 strcpy(host_name, /* known to fit */540 host_entry->h_name);536 len = sl_strlen(host_entry->h_name) + 1; 537 host_name = SH_ALLOC(len); 538 if (len > 1) 539 sl_strlcpy(host_name, host_entry->h_name, len); 541 540 else 542 541 host_name[0] = '\0'; … … 694 693 } 695 694 696 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) 695 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 697 696 static 698 697 int sh_write_select(int type, int sockfd, … … 714 713 */ 715 714 new_act.sa_handler = SIG_IGN; 715 sigemptyset( &new_act.sa_mask ); /* set an empty mask */ 716 new_act.sa_flags = 0; /* init sa_flags */ 716 717 sigaction (SIGPIPE, &new_act, &old_act); 717 718 … … 839 840 #endif 840 841 841 #if defined (SH_WITH_CLIENT) 842 #if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 842 843 unsigned long write_port (int sockfd, char *buf, unsigned long nbytes, 843 844 int * w_error, int timeout) … … 859 860 #endif 860 861 861 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) 862 #if defined(HAVE_NTIME) || defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 862 863 863 864 unsigned long read_port (int sockfd, char *buf, unsigned long nbytes, … … 895 896 #endif 896 897 897 #if defined (SH_WITH_CLIENT) 898 #if defined (SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 898 899 899 900 int check_request (char * have, char * need) … … 949 950 #endif 950 951 951 #if defined (SH_WITH_CLIENT) 952 #if defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER) 952 953 953 954 void get_header (unsigned char * head, unsigned long * bytes, char * u) … … 1029 1030 * (msg_size = payload_size - key_len = payload_size - 48) 1030 1031 */ 1032 1033 /* 1034 * only SH_V2_FULLSIZE is used, and only once 1035 */ 1036 #if 0 1031 1037 #ifdef SH_WITH_SERVER 1032 1038 #define SH_V2_FULLSIZE 240 … … 1038 1044 #define SH_V2_MESSAGE 960 1039 1045 #endif 1046 #endif 1047 #define SH_V2_FULLSIZE 1024 1040 1048 1041 1049 #ifdef SH_ENCRYPT … … 1380 1388 #endif 1381 1389 1382 #if defined (SH_WITH_CLIENT)1390 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 1383 1391 1384 1392 /* verify the checksum of a buffer; checksum comes first … … 1532 1540 #endif 1533 1541 1534 #if defined(SH_WITH_CLIENT) || defined(SH_ STEALTH) || defined(WITH_GPG) || defined(WITH_PGP)1542 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) || defined(SH_STEALTH) || defined(WITH_GPG) || defined(WITH_PGP) 1535 1543 1536 1544 /* --------- secure temporary file ------------ */
Note:
See TracChangeset
for help on using the changeset viewer.