Changeset 541
- Timestamp:
- Jan 16, 2019, 11:57:48 PM (6 years ago)
- Location:
- trunk/src
- Files:
-
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/samhain.c
r539 r541 838 838 (void) sh_unix_rm_pid_file (); 839 839 if (skey != NULL) 840 memset (skey, (int) '\0', sizeof(sh_key_t));840 memset (skey, 0, sizeof(sh_key_t)); 841 841 842 842 /* --- Exit. --- -
trunk/src/samhain_setpwd.c
r415 r541 246 246 char * oldpwd = (char *) malloc(5 * 8 + 2); 247 247 248 memset (newpwd, '\0', 5 * 8 + 2);249 memset (oldpwd, '\0', 5 * 8 + 2);248 memset (newpwd, 0, 5 * 8 + 2); 249 memset (oldpwd, 0, 5 * 8 + 2); 250 250 251 251 -
trunk/src/sh_audit.c
r516 r541 148 148 } 149 149 150 memset(&state, '\0', sizeof(state));150 memset(&state, 0, sizeof(state)); 151 151 152 152 while (ausearch_next_event(au) == 1) -
trunk/src/sh_database.c
r539 r541 284 284 static void init_db_entry (dbins * ptr) 285 285 { 286 memset (ptr, (int) '\0', sizeof(dbins));286 memset (ptr, 0, sizeof(dbins)); 287 287 ptr->next = NULL; 288 288 return; -
trunk/src/sh_dbIO.c
r538 r541 460 460 if (1 == 0) 461 461 hexdump((unsigned char *)&old_struct, sizeof(old_struct)); 462 memset(&try_struct, '\0', sizeof(try_struct));462 memset(&try_struct, 0, sizeof(try_struct)); 463 463 if (!memcmp(&old_struct, &try_struct, sizeof(try_struct))) 464 464 return 0; /* NULL read */ … … 1437 1437 1438 1438 if (!buf) { 1439 memset(&p, '\0', sizeof(sh_filestore_t));1439 memset(&p, 0, sizeof(sh_filestore_t)); 1440 1440 } 1441 1441 -
trunk/src/sh_entropy.c
r481 r541 334 334 nbytes = KEY_BYT; 335 335 336 memset(nbuf, '\0', nbytes);336 memset(nbuf, 0, nbytes); 337 337 338 338 #ifdef NAME_OF_DEV_URANDOM … … 370 370 /* -- Add previous entropy into the new pool. -- 371 371 */ 372 memset(addbuf, '\0', sizeof(addbuf));372 memset(addbuf, 0, sizeof(addbuf)); 373 373 for (i = 0; i < m_count; ++i) 374 374 addbuf[i] = nbuf[i]; … … 378 378 TIGER_DATA, 2 * KEY_BYT, 379 379 kbuf, KEY_BYT/sizeof(UINT32)); 380 memset(addbuf, '\0', sizeof(addbuf));380 memset(addbuf, 0, sizeof(addbuf)); 381 381 382 382 /* -- Give out nbytes bytes from the new pool. -- … … 390 390 } 391 391 SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); 392 memset (keybuf, '\0', KEY_BYT);393 memset (kbuf, '\0', sizeof(kbuf));392 memset (keybuf, 0, KEY_BYT); 393 memset (kbuf, 0, sizeof(kbuf)); 394 394 395 395 SL_RETURN(0, _("sh_entropy")); … … 416 416 #endif 417 417 #ifndef FD_ZERO 418 #define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p)))418 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) 419 419 #endif 420 420 … … 953 953 TIGER_DATA, sizeof(tseed), 954 954 kbuf, KEY_BYT/sizeof(UINT32)); 955 memset(addbuf, '\0', sizeof(addbuf));955 memset(addbuf, 0, sizeof(addbuf)); 956 956 for (i = 0; i < KEY_BYT; ++i) 957 957 { … … 974 974 /* add previous entropy into the new pool 975 975 */ 976 memset(addbuf, '\0', sizeof(addbuf));976 memset(addbuf, 0, sizeof(addbuf)); 977 977 for (i = 0; i < KEY_BYT; ++i) 978 978 { … … 983 983 TIGER_DATA, sizeof(addbuf), 984 984 kbuf, KEY_BYT/sizeof(UINT32)); 985 memset(addbuf, '\0', sizeof(addbuf));985 memset(addbuf, 0, sizeof(addbuf)); 986 986 987 987 /* store in system pool … … 992 992 skey->poolc = KEY_BYT; 993 993 SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); 994 memset (buffer, '\0', BUF_ENT+2);995 memset (keybuf, '\0', KEY_BYT);994 memset (buffer, 0, BUF_ENT+2); 995 memset (keybuf, 0, KEY_BYT); 996 996 SH_FREE(buffer); 997 997 } … … 1030 1030 for (count = 0; count < 20; ++count) 1031 1031 { 1032 memset(skey->poolv, '\0', KEY_BYT);1032 memset(skey->poolv, 0, KEY_BYT); 1033 1033 skey->poolc = 0; 1034 1034 … … 1036 1036 CuAssertTrue(tc, 0 == status); 1037 1037 1038 memset(skey->poolv, '\0', KEY_BYT);1038 memset(skey->poolv, 0, KEY_BYT); 1039 1039 skey->poolc = 0; 1040 1040 -
trunk/src/sh_err_console.c
r489 r541 141 141 } while (rc < 0 && errno == EINTR); 142 142 143 memset(&recv_msg, '\0', sizeof(recv_msg));143 memset(&recv_msg, 0, sizeof(recv_msg)); 144 144 return; 145 145 } … … 190 190 if (count > 1) 191 191 { 192 memset(recv_msg, '\0', MY_MAX_MSG+1);192 memset(recv_msg, 0, MY_MAX_MSG+1); 193 193 SH_FREE(recv_msg); 194 194 SL_RETURN(-1, _("push_message_queue")); … … 214 214 TPT(( 0, FIL__, __LINE__, _("msg=<msgsnd: %s> errno=<%d>\n"), 215 215 sh_error_message(errno, errbuf, sizeof(errbuf)), errno)); 216 memset(recv_msg, '\0', MY_MAX_MSG+1);216 memset(recv_msg, 0, MY_MAX_MSG+1); 217 217 SH_FREE(recv_msg); 218 218 SL_RETURN(-1, _("push_message_queue")); … … 220 220 } 221 221 222 memset(recv_msg, '\0', MY_MAX_MSG+1);222 memset(recv_msg, 0, MY_MAX_MSG+1); 223 223 SH_FREE(recv_msg); 224 224 -
trunk/src/sh_err_log.c
r516 r541 743 743 current->service_failure = 0; 744 744 current->log_start = S_TRUE; 745 memset(current->sigkey_old, (int)'\0', KEY_LEN+1);746 memset(current->sigkey_new, (int)'\0', KEY_LEN+1);747 memset(current->crypto, (int)'\0', KEY_LEN+1);745 memset(current->sigkey_old, 0, KEY_LEN+1); 746 memset(current->sigkey_new, 0, KEY_LEN+1); 747 memset(current->crypto, 0, KEY_LEN+1); 748 748 current->next = logfile_list; 749 749 logfile_list = current; … … 944 944 945 945 946 memset (crypto, (int) '\0', KEY_LEN);946 memset (crypto, 0, KEY_LEN); 947 947 sh.flag.log_start = S_FALSE; 948 948 current->log_start = S_FALSE; … … 1046 1046 /* --- Clean up and free record. --- 1047 1047 */ 1048 memset (log_msg.msg, (int)'\0', (size_t)(status + 2*KEY_LEN + 32));1049 memset (log_msg.signature, (int)'\0', KEY_LEN);1048 memset (log_msg.msg, 0, (size_t)(status + 2*KEY_LEN + 32)); 1049 memset (log_msg.signature, 0, KEY_LEN); 1050 1050 (void) sh_unix_munlock (log_msg.msg, 1051 1051 (size_t)(status + 2*KEY_LEN + 32)); -
trunk/src/sh_error.c
r510 r541 1442 1442 sh_replace_free(hexmsg); 1443 1443 1444 memset ( lmsg, (int) '\0', sizeof(struct _log_t) );1444 memset ( lmsg, 0, sizeof(struct _log_t) ); 1445 1445 MUNLOCK( (char *) lmsg, sizeof(struct _log_t) ); 1446 1446 SH_FREE( lmsg ); -
trunk/src/sh_filter.c
r232 r541 293 293 sh_filter_type * filter = SH_ALLOC(sizeof(sh_filter_type)); 294 294 295 memset(filter, '\0', sizeof(sh_filter_type));295 memset(filter, 0, sizeof(sh_filter_type)); 296 296 filter->for_c = 0; 297 297 filter->fand_c = 0; -
trunk/src/sh_gpg.c
r481 r541 457 457 * gpg. 458 458 */ 459 memset (skey, '\0', sizeof(sh_key_t));459 memset (skey, 0, sizeof(sh_key_t)); 460 460 aud_setuid(FIL__, __LINE__, geteuid()); 461 461 -
trunk/src/sh_ipvx.c
r539 r541 208 208 void sh_ipvx_save(struct sh_sockaddr * ss, int sa_family, struct sockaddr * sa) 209 209 { 210 /* memset(ss, '\0', sizeof(struct sh_sockaddr)); */211 212 210 switch (sa_family) 213 211 { … … 278 276 struct addrinfo *res; 279 277 280 memset(&hints, '\0', sizeof(hints));278 memset(&hints, 0, sizeof(hints)); 281 279 hints.ai_family = PF_UNSPEC; 282 280 hints.ai_flags = AI_NUMERICHOST; … … 286 284 return 0; 287 285 288 memset(ss, '\0', sizeof(struct sh_sockaddr));286 memset(ss, 0, sizeof(struct sh_sockaddr)); 289 287 switch(res->ai_family) 290 288 { … … 514 512 sl_snprintf(sport, sizeof(sport), "%d", port); 515 513 516 memset(&hints, '\0', sizeof(hints));514 memset(&hints, 0, sizeof(hints)); 517 515 hints.ai_socktype = SOCK_STREAM; 518 516 hints.ai_flags = AI_ADDRCONFIG; -
trunk/src/sh_log_check.c
r481 r541 601 601 SH_MUTEX_UNLOCK(mutex_thread_nolog); 602 602 603 memset (&(logfile->offset), '\0', sizeof(fpos_t));603 memset (&(logfile->offset), 0, sizeof(fpos_t)); 604 604 logfile->flags |= SH_LOGFILE_REWIND; 605 605 return 0; … … 623 623 /* done with rotated file, start with current file 624 624 */ 625 memset (&(logfile->offset), '\0', sizeof(fpos_t));625 memset (&(logfile->offset), 0, sizeof(fpos_t)); 626 626 logfile->flags |= SH_LOGFILE_REWIND; 627 627 logfile->flags &= ~SH_LOGFILE_MOVED; … … 646 646 else 647 647 { 648 memset (&(logfile->offset), '\0', sizeof(fpos_t));648 memset (&(logfile->offset), 0, sizeof(fpos_t)); 649 649 logfile->flags |= SH_LOGFILE_REWIND; 650 650 logfile->inode = buf.st_ino; … … 965 965 if (status != 1) 966 966 { 967 memset(s, '\0', size);967 memset(s, 0, size); 968 968 if (ferror(logfile->fp) && (logfile->flags & SH_LOGFILE_PIPE) == 0) 969 969 { -
trunk/src/sh_log_evalrule.c
r539 r541 186 186 187 187 ng = SH_ALLOC(sizeof(struct sh_geval)); 188 memset(ng, '\0', sizeof(struct sh_geval));188 memset(ng, 0, sizeof(struct sh_geval)); 189 189 190 190 ng->label = sh_string_new_from_lchar(splits[0], lengths[0]); … … 294 294 295 295 nh = SH_ALLOC(sizeof(struct sh_heval)); 296 memset(nh, '\0', sizeof(struct sh_heval));296 memset(nh, 0, sizeof(struct sh_heval)); 297 297 298 298 nh->hostname = host; … … 362 362 363 363 nq = SH_ALLOC(sizeof(struct sh_qeval)); 364 memset(nq, '\0', sizeof(struct sh_qeval));364 memset(nq, 0, sizeof(struct sh_qeval)); 365 365 366 366 nq->label = sh_string_new_from_lchar(splits[0], lengths[0]); … … 620 620 621 621 nr = SH_ALLOC(sizeof(struct sh_geval)); 622 memset(nr, '\0', sizeof(struct sh_geval));622 memset(nr, 0, sizeof(struct sh_geval)); 623 623 624 624 nr->label = NULL; … … 1142 1142 1143 1143 counter = SH_ALLOC(sizeof(struct sh_ceval)); 1144 memset(counter, '\0', sizeof(struct sh_ceval));1144 memset(counter, 0, sizeof(struct sh_ceval)); 1145 1145 1146 1146 counter->hostname = sh_string_new_from_lchar(sh_string_str(host), -
trunk/src/sh_log_parse_apache.c
r481 r541 354 354 char * ptr = NULL; 355 355 356 memset(&btime, '\0', sizeof(struct tm));356 memset(&btime, 0, sizeof(struct tm)); 357 357 btime.tm_isdst = -1; 358 358 -
trunk/src/sh_log_parse_samba.c
r357 r541 75 75 char * ptr; 76 76 77 memset(&btime, '\0', sizeof(struct tm));77 memset(&btime, 0, sizeof(struct tm)); 78 78 btime.tm_isdst = -1; 79 79 -
trunk/src/sh_log_parse_syslog.c
r481 r541 94 94 size_t lengths[3]; 95 95 96 memset(&btime, '\0', sizeof(struct tm));96 memset(&btime, 0, sizeof(struct tm)); 97 97 btime.tm_isdst = -1; 98 98 -
trunk/src/sh_login_track.c
r405 r541 232 232 233 233 urecord = SH_ALLOC(sizeof(struct sh_track)); 234 memset(urecord, '\0', sizeof(struct sh_track));234 memset(urecord, 0, sizeof(struct sh_track)); 235 235 236 236 uhead = &(urecord->head); … … 445 445 { 446 446 u = SH_ALLOC(sizeof(struct sh_track_dates)); 447 memset(u, '\0', sizeof(struct sh_track_dates));447 memset(u, 0, sizeof(struct sh_track_dates)); 448 448 sl_strlcpy(u->user, user, SH_LTRACK_USIZE); 449 449 flag = 1; … … 913 913 { 914 914 entry = SH_ALLOC(sizeof(struct sh_track_entry)); 915 memset(entry, '\0', sizeof(struct sh_track_entry));915 memset(entry, 0, sizeof(struct sh_track_entry)); 916 916 (entry->data).last_login = time; 917 917 (entry->data).array[index] = 1; -
trunk/src/sh_port2proc.c
r481 r541 635 635 memcpy(xbuf, buf, len0); 636 636 else 637 memset(xbuf, '\0', len);637 memset(xbuf, 0, len); 638 638 SH_FREE(buf); 639 639 } … … 823 823 824 824 sock = SH_ALLOC(sizeof *sock); 825 memset(sock, '\0', sizeof (*sock));825 memset(sock, 0, sizeof (*sock)); 826 826 827 827 #ifndef in6p_lport -
trunk/src/sh_portcheck.c
r539 r541 1410 1410 SH_MUTEX_UNLOCK(mutex_resolv); 1411 1411 #else 1412 memset(&hints, '\0', sizeof(hints));1412 memset(&hints, 0, sizeof(hints)); 1413 1413 hints.ai_family = PF_UNSPEC; 1414 1414 hints.ai_flags = AI_ADDRCONFIG; -
trunk/src/sh_registry.c
r539 r541 350 350 struct store2db save; 351 351 352 memset(&save, '\0', sizeof(struct store2db));352 memset(&save, 0, sizeof(struct store2db)); 353 353 sh_hash_db2pop (path, &save); 354 354 … … 682 682 struct store2db save; 683 683 684 memset(&save, '\0', sizeof(struct store2db));684 memset(&save, 0, sizeof(struct store2db)); 685 685 686 686 if (tPath) … … 774 774 struct store2db save; 775 775 776 memset(&save, '\0', sizeof(struct store2db));776 memset(&save, 0, sizeof(struct store2db)); 777 777 778 778 save.val0 = totalSize; -
trunk/src/sh_tiger0.c
r539 r541 379 379 ncount = 0; 380 380 #endif 381 sl_memset(bbuf, 0, 56 );381 memset(bbuf, 0, 56 ); 382 382 } 383 383 … … 402 402 #endif 403 403 404 sl_memset (bbuf, '\0', sizeof(bbuf));405 sl_memset (buffer, '\0', sizeof(buffer));404 memset (bbuf, 0, sizeof(bbuf)); 405 memset (buffer, 0, sizeof(buffer)); 406 406 407 407 if (what == TIGER_FILE) -
trunk/src/sh_tools.c
r539 r541 70 70 #endif 71 71 #ifndef FD_ZERO 72 #define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p)))72 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) 73 73 #endif 74 74 … … 135 135 int res; 136 136 137 memset (&hints, '\0', sizeof (hints));137 memset (&hints, 0, sizeof (hints)); 138 138 hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; 139 139 hints.ai_socktype = SOCK_STREAM; … … 180 180 int sd; 181 181 182 memset(&sin, '\0', sizeof(sin));182 memset(&sin, 0, sizeof(sin)); 183 183 sin.sin_family = AF_INET; 184 184 if (inet_aton(str, &(sin.sin_addr))) … … 915 915 fputs(_("-03- not cached\n"), stderr); 916 916 917 memset (&hints, '\0', sizeof (hints));917 memset (&hints, 0, sizeof (hints)); 918 918 hints.ai_flags = AI_ADDRCONFIG; 919 919 #if defined(AI_CANONNAME) … … 1668 1668 if ((i_blk*16) > payload_size && !oflow) 1669 1669 { 1670 memset(&full_ret[16+payload_size], '\0', (i_blk*16) - payload_size);1670 memset(&full_ret[16+payload_size], 0, (i_blk*16) - payload_size); 1671 1671 payload_size = i_blk * 16; 1672 1672 } 1673 memset(&full_ret[16+payload_size], '\0', i_epad*16);1673 memset(&full_ret[16+payload_size], 0, i_epad*16); 1674 1674 1675 1675 /* rewrite header -
trunk/src/sh_unix.c
r539 r541 83 83 #endif 84 84 #ifndef FD_ZERO 85 #define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p)))85 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) 86 86 #endif 87 87 … … 514 514 ++immediate_exit_normal; 515 515 if ((skey != NULL) && (immediate_exit_normal == 2)) 516 memset (skey, '\0', sizeof(sh_key_t));516 memset (skey, 0, sizeof(sh_key_t)); 517 517 if (immediate_exit_normal == 2) 518 518 { … … 579 579 ++immediate_exit_fast; 580 580 if (skey != NULL && immediate_exit_fast < 2) 581 memset (skey, '\0', sizeof(sh_key_t));581 memset (skey, 0, sizeof(sh_key_t)); 582 582 if (immediate_exit_fast < 2) 583 583 safe_logger (mysignal, 0, NULL); … … 591 591 ++immediate_exit_fast; 592 592 if (skey != NULL) 593 memset (skey, '\0', sizeof(sh_key_t));593 memset (skey, 0, sizeof(sh_key_t)); 594 594 close_ipc (); 595 595 safe_logger (mysignal, 0, NULL); … … 631 631 632 632 if (skey != NULL) 633 memset (skey, '\0', sizeof(sh_key_t));633 memset (skey, 0, sizeof(sh_key_t)); 634 634 close_ipc (); 635 635 -
trunk/src/sh_utils.c
r504 r541 1088 1088 SH_MUTEX_UNLOCK_UNSAFE(mutex_skey); 1089 1089 1090 memset(taus_svec, '\0', TAUS_SAMPLE * sizeof(UINT32));1090 memset(taus_svec, 0, TAUS_SAMPLE * sizeof(UINT32)); 1091 1091 1092 1092 return retval; -
trunk/src/sh_utmp.c
r481 r541 875 875 if (memcmp (&save_utmp, ut, sizeof(struct SH_UTMP_S)) == 0) 876 876 { 877 memset(&save_utmp, (int) '\0', sizeof(struct SH_UTMP_S));877 memset(&save_utmp, 0, sizeof(struct SH_UTMP_S)); 878 878 SL_RET0(_("sh_utmp_addlogin")); 879 879 } -
trunk/src/sh_xfer_client.c
r489 r541 97 97 #endif 98 98 #ifndef FD_ZERO 99 #define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p)))99 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) 100 100 #endif 101 101 … … 1051 1051 xfer_timeout_val *= 2; 1052 1052 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_TCP_NOAUTH); 1053 memset(answer, '\0', 512);1053 memset(answer, 0, 512); 1054 1054 MUNLOCK(answer, 512); 1055 1055 SH_FREE(answer); -
trunk/src/sh_xfer_server.c
r539 r541 105 105 #endif 106 106 #ifndef FD_ZERO 107 #define FD_ZERO(p) memset((char *)(p), '\0', sizeof(*(p)))107 #define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) 108 108 #endif 109 109 … … 1789 1789 clt_class = (-1); 1790 1790 } 1791 memset(buffer, '\0', sl_strlen(buffer));1791 memset(buffer, 0, sl_strlen(buffer)); 1792 1792 SH_FREE(buffer); 1793 1793 … … 1847 1847 #endif 1848 1848 1849 memset(buffer, '\0', sl_strlen(buffer));1849 memset(buffer, 0, sl_strlen(buffer)); 1850 1850 SH_FREE(buffer); 1851 1851 … … 3104 3104 if (use_server_interface == 0) /* INADDR_ANY, listen on all interfaces */ 3105 3105 { 3106 memset (&hints, '\0', sizeof (hints));3106 memset (&hints, 0, sizeof (hints)); 3107 3107 hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; 3108 3108 hints.ai_socktype = SOCK_STREAM; -
trunk/src/sh_xfer_syslog.c
r481 r541 435 435 436 436 #else 437 memset (&hints, '\0', sizeof (hints));437 memset (&hints, 0, sizeof (hints)); 438 438 hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; 439 439 hints.ai_socktype = SOCK_DGRAM; -
trunk/src/t-test0.c
r481 r541 166 166 if(size == 0) return; 167 167 #if TEST > 3 168 memset(ptr, '\0', size);168 memset(ptr, 0, size); 169 169 #endif 170 170 for(i=0; i<size; i+=2047) {
Note:
See TracChangeset
for help on using the changeset viewer.