Changeset 473
- Timestamp:
- May 29, 2015, 10:42:18 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docs/Changelog
r472 r473 1 1 2 * Modify testcompile.sh to remove 'uno' and use 'cppcheck' 3 for static checking 2 4 * Move AC_CHECK_FUNCS( getnameinfo getaddrinfo ) behind 3 5 the check for libsocket to have them found on Solaris -
trunk/src/samhain.c
r454 r473 156 156 ptr->g_glob = calloc(1, SH_MAX_GLOBS * (GLOB_LEN+1)); 157 157 if (!(ptr->g_glob)) 158 return -1; 158 { 159 free(ptr); 160 return -1; 161 } 159 162 return pthread_setspecific(g_key, ptr); 160 163 } -
trunk/src/sh_calls.c
r472 r473 200 200 error = errno; 201 201 if (val_retry != 0) { 202 long eport ;202 long eport = 0; 203 203 char eaddr[SH_IP_BUF]; 204 204 char emesg[SH_BUFSIZE]; -
trunk/src/sh_entropy.c
r460 r473 640 640 } 641 641 642 /* cppcheck-suppress leakNoVarFunctionCall */ 642 643 if (NULL != freopen (_("/dev/null"), "r+", stderr)) 643 644 { -
trunk/src/sh_html.c
r454 r473 311 311 if (entry_orig != NULL) 312 312 { 313 entry_orig= realloc(entry_orig, /* free() ok */313 char * ptr = realloc(entry_orig, /* free() ok */ 314 314 entry_size + line_size + 1); 315 if (entry_orig) { add_size = line_size; } 315 if (ptr) { 316 entry_orig = ptr; 317 add_size = line_size; 318 } else { 319 { free(entry_orig); entry_orig = NULL; } 320 } 316 321 } 317 322 else -
trunk/src/sh_portcheck.c
r468 r473 1688 1688 char * interface, int type) 1689 1689 { 1690 char buf[256] ;1690 char buf[256] = { '\0' }; 1691 1691 int proto; 1692 1692 char * p; -
trunk/src/sh_srp.c
r454 r473 114 114 size = strlen(str) + 1; 115 115 if (size > siz_str_internal) 116 get_str_internal = realloc (get_str_internal, size); 116 { 117 char * ptr = realloc (get_str_internal, size); 118 if (ptr) 119 get_str_internal = ptr; 120 else 121 { free(get_str_internal); get_str_internal = NULL; } 122 } 117 123 if (get_str_internal == NULL) 118 124 { -
trunk/src/sh_static.c
r454 r473 1641 1641 ; /* 'label at end of compound statement' */ 1642 1642 SH_MUTEX_UNLOCK(resolv_lock); 1643 /* cppcheck-suppress resourceLeak */ 1643 1644 return 0; 1644 1645 } -
trunk/src/sh_unix.c
r462 r473 1504 1504 if (env1[envlen] == NULL) 1505 1505 { 1506 int i; 1506 1507 fprintf(stderr, _("%s: %d: Out of memory\n"), FIL__, __LINE__); 1508 for (i = 0; i < envlen; ++i) free(env1[len]); 1509 free(env1); 1507 1510 SL_RET0(_("sh_unix_copyenv")); 1508 1511 } … … 5672 5675 5673 5676 sigtrap_variables->not_traced = signum; 5677 /* cppcheck-suppress memleak */ 5674 5678 return; 5675 5679 } -
trunk/src/sh_utils.c
r454 r473 1315 1315 while (0 < (ii = sl_read (fp, &image[s], 4096))) 1316 1316 { 1317 unsigned char * ptr; 1317 1318 ilen += ii; 1318 1319 s += 4096; 1319 image = realloc (image, (size_t) (4096 + s)); 1320 ptr = realloc (image, (size_t) (4096 + s)); 1321 if (ptr) 1322 image = ptr; 1323 else 1324 { free(image); image = NULL; } 1320 1325 if (!image) 1321 1326 goto bail_mem; -
trunk/src/slib.c
r454 r473 1738 1738 /* Make entry. 1739 1739 */ 1740 /* cppcheck-suppress arrayIndexOutOfBoundsCond */ 1740 1741 if (fd >= MAXFD || fd < 0) 1741 1742 { … … 2010 2011 /* Make entry. 2011 2012 */ 2013 /* cppcheck-suppress arrayIndexOutOfBoundsCond */ 2012 2014 if (fd >= MAXFD) 2013 2015 { -
trunk/test/testcompile.sh
r378 r473 20 20 # 21 21 22 # dnmalloc + flawfinder + (36 * 3)23 MAXTEST= 116; export MAXTEST22 # dnmalloc + cppcheck + flawfinder + (38 * 2) 23 MAXTEST=79; export MAXTEST 24 24 25 25 run_dnmalloc () … … 83 83 } 84 84 85 run_ uno()85 run_cppcheck () 86 86 { 87 87 if [ -z "$doall" ]; then 88 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} " $TEST (uno)";88 [ -z "$quiet" ] && log_skip $2 ${MAXTEST} "check w/cppcheck"; 89 89 return 0 90 90 fi 91 91 # 92 UNO=`find_path uno`92 CPC=`find_path cppcheck` 93 93 # 94 if [ -z "$ UNO" ]; then95 log_skip $num $ MAXTEST 'check w/uno(not in PATH)'94 if [ -z "$CPC" ]; then 95 log_skip $num ${MAXTEST} 'check w/cppcheck (not in PATH)' 96 96 return 0 97 97 fi 98 98 # 99 99 cd src/ 100 stat=` uno -DHAVE_MMAP=1 -DUSE_UNO=1 -t-I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l`101 if [ $stat -ne 1]; then102 uno -DSH_WITH_CLIENT -DSH_WITH_SERVER -DHAVE_MMAP=1 -DUSE_UNO=1 -t-I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1100 stat=`cppcheck --quiet --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c 2>&1 | wc -l` 101 if [ $stat -ne 0 ]; then 102 cppcheck --quiet --inline-suppr --force -j 4 --template="{file},{line},{severity},{id},{message}" -I. -I.. -I../include sh_*.c samhain.c slib.c dnmalloc.c zAVLTree.c trustfile.c rijndael-*.c bignum.c >>../test_log 2>&1 103 103 retval=1 104 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} " $TEST (uno)";104 [ -z "$quiet" ] && log_fail $2 ${MAXTEST} "check w/cppcheck"; 105 105 else 106 106 retval=0 107 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} " $TEST (uno)";107 [ -z "$quiet" ] && log_ok $2 ${MAXTEST} "check w/cppcheck"; 108 108 fi 109 109 cd .. … … 303 303 304 304 # 305 # test dnmalloc 306 # 307 TEST="${S}check w/cppcheck${E}" 308 # 309 let "num = num + 1" >/dev/null 310 # 311 run_cppcheck 0 $num || let "numfail = numfail + 1" >/dev/null 312 # 313 314 # 305 315 # test flawfinder 306 316 # … … 333 343 let "num = num + 1" >/dev/null 334 344 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 335 let "num = num + 1" >/dev/null336 run_uno $? $num || let "numfail = numfail + 1" >/dev/null337 345 338 346 # … … 353 361 let "num = num + 1" >/dev/null 354 362 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 355 let "num = num + 1" >/dev/null356 run_uno $? $num || let "numfail = numfail + 1" >/dev/null357 363 # 358 364 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } … … 372 378 let "num = num + 1" >/dev/null 373 379 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 374 let "num = num + 1" >/dev/null375 run_uno $? $num || let "numfail = numfail + 1" >/dev/null376 380 377 381 # … … 392 396 let "num = num + 1" >/dev/null 393 397 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 394 let "num = num + 1" >/dev/null395 run_uno $? $num || let "numfail = numfail + 1" >/dev/null396 398 # 397 399 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } … … 411 413 let "num = num + 1" >/dev/null 412 414 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 413 let "num = num + 1" >/dev/null414 run_uno $? $num || let "numfail = numfail + 1" >/dev/null415 415 416 416 # … … 429 429 let "num = num + 1" >/dev/null 430 430 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 431 let "num = num + 1" >/dev/null432 run_uno $? $num || let "numfail = numfail + 1" >/dev/null433 431 434 432 … … 448 446 let "num = num + 1" >/dev/null 449 447 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 450 let "num = num + 1" >/dev/null451 run_uno $? $num || let "numfail = numfail + 1" >/dev/null452 448 453 449 # … … 466 462 let "num = num + 1" >/dev/null 467 463 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 468 let "num = num + 1" >/dev/null469 run_uno $? $num || let "numfail = numfail + 1" >/dev/null470 464 471 465 # … … 484 478 let "num = num + 1" >/dev/null 485 479 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 486 let "num = num + 1" >/dev/null487 run_uno $? $num || let "numfail = numfail + 1" >/dev/null488 480 489 481 # … … 509 501 let "num = num + 1" >/dev/null 510 502 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 511 let "num = num + 1" >/dev/null512 run_uno $? $num || let "numfail = numfail + 1" >/dev/null513 503 fi 514 504 … … 528 518 let "num = num + 1" >/dev/null 529 519 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 530 let "num = num + 1" >/dev/null531 run_uno $? $num || let "numfail = numfail + 1" >/dev/null532 520 533 521 # … … 546 534 let "num = num + 1" >/dev/null 547 535 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 548 let "num = num + 1" >/dev/null549 run_uno $? $num || let "numfail = numfail + 1" >/dev/null550 536 551 537 # … … 564 550 let "num = num + 1" >/dev/null 565 551 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 566 let "num = num + 1" >/dev/null567 run_uno $? $num || let "numfail = numfail + 1" >/dev/null568 552 569 553 # … … 582 566 let "num = num + 1" >/dev/null 583 567 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 584 let "num = num + 1" >/dev/null585 run_uno $? $num || let "numfail = numfail + 1" >/dev/null586 568 587 569 # … … 600 582 let "num = num + 1" >/dev/null 601 583 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 602 let "num = num + 1" >/dev/null603 run_uno $? $num || let "numfail = numfail + 1" >/dev/null604 584 605 585 # … … 618 598 let "num = num + 1" >/dev/null 619 599 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 620 let "num = num + 1" >/dev/null621 run_uno $? $num || let "numfail = numfail + 1" >/dev/null622 600 623 601 # … … 636 614 let "num = num + 1" >/dev/null 637 615 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 638 let "num = num + 1" >/dev/null639 run_uno $? $num || let "numfail = numfail + 1" >/dev/null640 616 641 617 # … … 654 630 let "num = num + 1" >/dev/null 655 631 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 656 let "num = num + 1" >/dev/null657 run_uno $? $num || let "numfail = numfail + 1" >/dev/null658 632 659 633 # echo; echo "${S}__ TEST CLIENT/SERVER __${E}"; echo; … … 674 648 let "num = num + 1" >/dev/null 675 649 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 676 let "num = num + 1" >/dev/null677 run_uno $? $num || let "numfail = numfail + 1" >/dev/null678 650 679 651 if test -r "Makefile"; then … … 687 659 let "num = num + 1" >/dev/null 688 660 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 689 let "num = num + 1" >/dev/null690 run_uno $? $num || let "numfail = numfail + 1" >/dev/null691 661 692 662 # … … 700 670 let "num = num + 1" >/dev/null 701 671 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)"; 702 let "num = num + 1" >/dev/null703 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";704 672 705 673 let "num = num + 1" >/dev/null … … 707 675 let "num = num + 1" >/dev/null 708 676 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (smatch)"; 709 let "num = num + 1" >/dev/null710 [ -z "$quiet" ] && log_skip $num ${MAXTEST} "$TEST (uno)";711 677 else 712 678 if test -r "Makefile"; then … … 720 686 let "num = num + 1" >/dev/null 721 687 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 722 let "num = num + 1" >/dev/null723 run_uno $? $num || let "numfail = numfail + 1" >/dev/null724 688 725 689 if test -r "Makefile"; then … … 733 697 let "num = num + 1" >/dev/null 734 698 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 735 let "num = num + 1" >/dev/null736 run_uno $? $num || let "numfail = numfail + 1" >/dev/null737 699 # 738 700 fi … … 755 717 let "num = num + 1" >/dev/null 756 718 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 757 let "num = num + 1" >/dev/null758 run_uno $? $num || let "numfail = numfail + 1" >/dev/null759 719 760 720 if test -r "Makefile"; then … … 768 728 let "num = num + 1" >/dev/null 769 729 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 770 let "num = num + 1" >/dev/null771 run_uno $? $num || let "numfail = numfail + 1" >/dev/null772 730 # 773 731 [ -z "${SMATCH_CC}" ] || { CC="${SMATCH_CC}"; export CC; SMATCH="${SAVE_SMATCH}"; export SMATCH; } … … 798 756 let "num = num + 1" >/dev/null 799 757 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 800 let "num = num + 1" >/dev/null801 run_uno $? $num || let "numfail = numfail + 1" >/dev/null802 758 # 803 759 if test -r "Makefile"; then … … 811 767 let "num = num + 1" >/dev/null 812 768 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 813 let "num = num + 1" >/dev/null814 run_uno $? $num || let "numfail = numfail + 1" >/dev/null815 769 fi 816 770 … … 831 785 let "num = num + 1" >/dev/null 832 786 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 833 let "num = num + 1" >/dev/null834 run_uno $? $num || let "numfail = numfail + 1" >/dev/null835 787 # 836 788 if test -r "Makefile"; then … … 844 796 let "num = num + 1" >/dev/null 845 797 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 846 let "num = num + 1" >/dev/null847 run_uno $? $num || let "numfail = numfail + 1" >/dev/null848 798 849 799 # … … 862 812 let "num = num + 1" >/dev/null 863 813 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 864 let "num = num + 1" >/dev/null865 run_uno $? $num || let "numfail = numfail + 1" >/dev/null866 814 # 867 815 if test -r "Makefile"; then … … 875 823 let "num = num + 1" >/dev/null 876 824 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 877 let "num = num + 1" >/dev/null878 run_uno $? $num || let "numfail = numfail + 1" >/dev/null879 825 880 826 # … … 893 839 let "num = num + 1" >/dev/null 894 840 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 895 let "num = num + 1" >/dev/null896 run_uno $? $num || let "numfail = numfail + 1" >/dev/null897 841 # 898 842 if test -r "Makefile"; then … … 906 850 let "num = num + 1" >/dev/null 907 851 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 908 let "num = num + 1" >/dev/null909 run_uno $? $num || let "numfail = numfail + 1" >/dev/null910 852 911 853 # … … 924 866 let "num = num + 1" >/dev/null 925 867 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 926 let "num = num + 1" >/dev/null927 run_uno $? $num || let "numfail = numfail + 1" >/dev/null928 868 # 929 869 if test -r "Makefile"; then … … 937 877 let "num = num + 1" >/dev/null 938 878 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 939 let "num = num + 1" >/dev/null940 run_uno $? $num || let "numfail = numfail + 1" >/dev/null941 879 942 880 # … … 955 893 let "num = num + 1" >/dev/null 956 894 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 957 let "num = num + 1" >/dev/null958 run_uno $? $num || let "numfail = numfail + 1" >/dev/null959 895 # 960 896 if test -r "Makefile"; then … … 968 904 let "num = num + 1" >/dev/null 969 905 run_smatch $? $num debug || let "numfail = numfail + 1" >/dev/null 970 let "num = num + 1" >/dev/null971 run_uno $? $num || let "numfail = numfail + 1" >/dev/null972 906 973 907 # … … 986 920 let "num = num + 1" >/dev/null 987 921 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 988 let "num = num + 1" >/dev/null989 run_uno $? $num || let "numfail = numfail + 1" >/dev/null990 922 # 991 923 if test -r "Makefile"; then … … 999 931 let "num = num + 1" >/dev/null 1000 932 run_smatch $? $num || let "numfail = numfail + 1" >/dev/null 1001 let "num = num + 1" >/dev/null1002 run_uno $? $num || let "numfail = numfail + 1" >/dev/null1003 933 1004 934 [ -z "${SMATCH}" ] || { CC="${SAVE_CC}"; export CC; }
Note:
See TracChangeset
for help on using the changeset viewer.