Lines Matching refs:buf
363 char buf[10]; in TEST_F() local
365 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
375 char buf[0]; in TEST_F() local
377 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
387 char buf[0]; in TEST_F() local
389 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
399 char buf[1]; in TEST_F() local
401 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
410 char buf[10]; in TEST_F() local
411 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
412 ASSERT_FORTIFY(printf("%zd", strlen(buf))); in TEST_F()
420 char buf[10]; in TEST_F() local
421 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
422 ASSERT_FORTIFY(printf("%s", strchr(buf, 'a'))); in TEST_F()
430 char buf[10]; in TEST_F() local
431 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
432 ASSERT_FORTIFY(printf("%s", strrchr(buf, 'a'))); in TEST_F()
464 char buf[10]; in TEST_F() local
467 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf)); in TEST_F()
474 char* buf = (char *) malloc(10); in TEST_F() local
477 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf)); in TEST_F()
478 free(buf); in TEST_F()
483 char buf[5]; in TEST_F() local
484 ASSERT_FORTIFY(sprintf(buf, "aaaaa")); in TEST_F()
488 char buf[10]; in vsprintf_helper() local
493 result = vsprintf(buf, fmt, va); // should crash here in vsprintf_helper()
507 char buf[10]; in vsnprintf_helper() local
513 result = vsnprintf(buf, size, fmt, va); // should crash here in vsnprintf_helper()
527 char buf[10]; in TEST_F() local
529 strncpy(buf, "012345678", n); in TEST_F()
530 ASSERT_FORTIFY(strncat(buf, "9", n)); in TEST_F()
534 char buf[10]; in TEST_F() local
535 buf[0] = '\0'; in TEST_F()
537 ASSERT_FORTIFY(strncat(buf, "0123456789", n)); in TEST_F()
543 char buf[10]; in TEST_F() local
544 buf[0] = '\0'; in TEST_F()
545 ASSERT_FORTIFY(strcat(buf, src)); in TEST_F()
549 char buf[20]; in TEST_F() local
550 strcpy(buf, "0123456789"); in TEST_F()
552 ASSERT_FORTIFY(memmove(buf + 11, buf, n)); in TEST_F()
603 char buf[10]; in TEST_F() local
604 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
606 ASSERT_FORTIFY(bzero(buf, n)); in TEST_F()
616 char buf[10]; in TEST_F() local
617 ASSERT_FORTIFY(recv(0, buf, data_len, 0)); in TEST_F()
629 char buf[1]; in TEST_F() local
630 fd_set* set = (fd_set*) buf; in TEST_F()
635 char buf[1]; in TEST_F() local
637 ASSERT_FORTIFY(getcwd(buf, ct)); in TEST_F()
641 char buf[1]; in TEST_F() local
644 ASSERT_FORTIFY(pread(fd, buf, ct, 0)); in TEST_F()
649 char buf[1]; in TEST_F() local
652 ASSERT_FORTIFY(pread64(fd, buf, ct, 0)); in TEST_F()
657 char buf[1] = {0}; in TEST_F() local
660 ASSERT_FORTIFY(pwrite(fd, buf, ct, 0)); in TEST_F()
665 char buf[1] = {0}; in TEST_F() local
668 ASSERT_FORTIFY(pwrite64(fd, buf, ct, 0)); in TEST_F()
673 char buf[1]; in TEST_F() local
676 ASSERT_FORTIFY(read(fd, buf, ct)); in TEST_F()
681 char buf[1] = {0}; in TEST_F() local
684 ASSERT_EXIT(write(fd, buf, ct), testing::KilledBySignal(SIGABRT), ""); in TEST_F()
689 char buf[1]; in TEST_F() local
692 ASSERT_FORTIFY(fread(buf, 1, ct, fp)); in TEST_F()
697 char buf[1] = {0}; in TEST_F() local
700 ASSERT_FORTIFY(fwrite(buf, 1, ct, fp)); in TEST_F()
705 char buf[1]; in TEST_F() local
707 ASSERT_FORTIFY(readlink("/dev/null", buf, ct)); in TEST_F()
711 char buf[1]; in TEST_F() local
713 ASSERT_FORTIFY(readlinkat(AT_FDCWD, "/dev/null", buf, ct)); in TEST_F()
720 char buf[10]; in TEST() local
721 memset(buf, 'A', sizeof(buf)); in TEST()
722 buf[0] = 'a'; in TEST()
723 buf[1] = '\0'; in TEST()
724 char* res = __strncat_chk(buf, "01234", sizeof(buf) - strlen(buf) - 1, sizeof(buf)); in TEST()
725 ASSERT_EQ(buf, res); in TEST()
726 ASSERT_EQ('a', buf[0]); in TEST()
727 ASSERT_EQ('0', buf[1]); in TEST()
728 ASSERT_EQ('1', buf[2]); in TEST()
729 ASSERT_EQ('2', buf[3]); in TEST()
730 ASSERT_EQ('3', buf[4]); in TEST()
731 ASSERT_EQ('4', buf[5]); in TEST()
732 ASSERT_EQ('\0', buf[6]); in TEST()
733 ASSERT_EQ('A', buf[7]); in TEST()
734 ASSERT_EQ('A', buf[8]); in TEST()
735 ASSERT_EQ('A', buf[9]); in TEST()
739 char buf[10]; in TEST() local
740 memset(buf, 'A', sizeof(buf)); in TEST()
741 buf[0] = 'a'; in TEST()
742 buf[1] = '\0'; in TEST()
743 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf)); in TEST()
744 ASSERT_EQ(buf, res); in TEST()
745 ASSERT_EQ('a', buf[0]); in TEST()
746 ASSERT_EQ('0', buf[1]); in TEST()
747 ASSERT_EQ('1', buf[2]); in TEST()
748 ASSERT_EQ('2', buf[3]); in TEST()
749 ASSERT_EQ('3', buf[4]); in TEST()
750 ASSERT_EQ('4', buf[5]); in TEST()
751 ASSERT_EQ('\0', buf[6]); in TEST()
752 ASSERT_EQ('A', buf[7]); in TEST()
753 ASSERT_EQ('A', buf[8]); in TEST()
754 ASSERT_EQ('A', buf[9]); in TEST()
758 char buf[10]; in TEST() local
759 memset(buf, 'A', sizeof(buf)); in TEST()
760 buf[0] = '\0'; in TEST()
761 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf)); in TEST()
762 ASSERT_EQ(buf, res); in TEST()
763 ASSERT_EQ('0', buf[0]); in TEST()
764 ASSERT_EQ('1', buf[1]); in TEST()
765 ASSERT_EQ('2', buf[2]); in TEST()
766 ASSERT_EQ('3', buf[3]); in TEST()
767 ASSERT_EQ('4', buf[4]); in TEST()
768 ASSERT_EQ('\0', buf[5]); in TEST()
769 ASSERT_EQ('A', buf[6]); in TEST()
770 ASSERT_EQ('A', buf[7]); in TEST()
771 ASSERT_EQ('A', buf[8]); in TEST()
772 ASSERT_EQ('A', buf[9]); in TEST()
776 char buf[10]; in TEST() local
777 memset(buf, 'A', sizeof(buf)); in TEST()
778 buf[9] = '\0'; in TEST()
779 char* res = __strncat_chk(buf, "", 5, sizeof(buf)); in TEST()
780 ASSERT_EQ(buf, res); in TEST()
781 ASSERT_EQ('A', buf[0]); in TEST()
782 ASSERT_EQ('A', buf[1]); in TEST()
783 ASSERT_EQ('A', buf[2]); in TEST()
784 ASSERT_EQ('A', buf[3]); in TEST()
785 ASSERT_EQ('A', buf[4]); in TEST()
786 ASSERT_EQ('A', buf[5]); in TEST()
787 ASSERT_EQ('A', buf[6]); in TEST()
788 ASSERT_EQ('A', buf[7]); in TEST()
789 ASSERT_EQ('A', buf[8]); in TEST()
790 ASSERT_EQ('\0', buf[9]); in TEST()
794 char buf[10]; in TEST() local
795 memset(buf, 'A', sizeof(buf)); in TEST()
796 buf[0] = 'a'; in TEST()
797 buf[1] = '\0'; in TEST()
798 char* res = __strncat_chk(buf, "01234567", 8, sizeof(buf)); in TEST()
799 ASSERT_EQ(buf, res); in TEST()
800 ASSERT_EQ('a', buf[0]); in TEST()
801 ASSERT_EQ('0', buf[1]); in TEST()
802 ASSERT_EQ('1', buf[2]); in TEST()
803 ASSERT_EQ('2', buf[3]); in TEST()
804 ASSERT_EQ('3', buf[4]); in TEST()
805 ASSERT_EQ('4', buf[5]); in TEST()
806 ASSERT_EQ('5', buf[6]); in TEST()
807 ASSERT_EQ('6', buf[7]); in TEST()
808 ASSERT_EQ('7', buf[8]); in TEST()
809 ASSERT_EQ('\0', buf[9]); in TEST()
813 char buf[10]; in TEST() local
814 memset(buf, 'A', sizeof(buf)); in TEST()
815 buf[0] = 'a'; in TEST()
816 buf[1] = '\0'; in TEST()
817 char* res = __strncat_chk(buf, "01234567", 9, sizeof(buf)); in TEST()
818 ASSERT_EQ(buf, res); in TEST()
819 ASSERT_EQ('a', buf[0]); in TEST()
820 ASSERT_EQ('0', buf[1]); in TEST()
821 ASSERT_EQ('1', buf[2]); in TEST()
822 ASSERT_EQ('2', buf[3]); in TEST()
823 ASSERT_EQ('3', buf[4]); in TEST()
824 ASSERT_EQ('4', buf[5]); in TEST()
825 ASSERT_EQ('5', buf[6]); in TEST()
826 ASSERT_EQ('6', buf[7]); in TEST()
827 ASSERT_EQ('7', buf[8]); in TEST()
828 ASSERT_EQ('\0', buf[9]); in TEST()
833 char buf[10]; in TEST() local
834 memset(buf, 'A', sizeof(buf)); in TEST()
835 buf[0] = 'a'; in TEST()
836 buf[1] = '\0'; in TEST()
837 char* res = __strcat_chk(buf, "01234", sizeof(buf)); in TEST()
838 ASSERT_EQ(buf, res); in TEST()
839 ASSERT_EQ('a', buf[0]); in TEST()
840 ASSERT_EQ('0', buf[1]); in TEST()
841 ASSERT_EQ('1', buf[2]); in TEST()
842 ASSERT_EQ('2', buf[3]); in TEST()
843 ASSERT_EQ('3', buf[4]); in TEST()
844 ASSERT_EQ('4', buf[5]); in TEST()
845 ASSERT_EQ('\0', buf[6]); in TEST()
846 ASSERT_EQ('A', buf[7]); in TEST()
847 ASSERT_EQ('A', buf[8]); in TEST()
848 ASSERT_EQ('A', buf[9]); in TEST()
852 char buf[10]; in TEST() local
853 memset(buf, 'A', sizeof(buf)); in TEST()
854 buf[0] = 'a'; in TEST()
855 buf[1] = '\0'; in TEST()
856 char* res = __strcat_chk(buf, "01234567", sizeof(buf)); in TEST()
857 ASSERT_EQ(buf, res); in TEST()
858 ASSERT_EQ('a', buf[0]); in TEST()
859 ASSERT_EQ('0', buf[1]); in TEST()
860 ASSERT_EQ('1', buf[2]); in TEST()
861 ASSERT_EQ('2', buf[3]); in TEST()
862 ASSERT_EQ('3', buf[4]); in TEST()
863 ASSERT_EQ('4', buf[5]); in TEST()
864 ASSERT_EQ('5', buf[6]); in TEST()
865 ASSERT_EQ('6', buf[7]); in TEST()
866 ASSERT_EQ('7', buf[8]); in TEST()
867 ASSERT_EQ('\0', buf[9]); in TEST()
949 char buf[10]; in TEST() local
950 memset(buf, 'A', sizeof(buf)); in TEST()
951 buf[0] = 'a'; in TEST()
952 buf[1] = '\0'; in TEST()
953 char* res = __strcat_chk(buf, "01234567", (size_t)-1); in TEST()
954 ASSERT_EQ(buf, res); in TEST()
955 ASSERT_EQ('a', buf[0]); in TEST()
956 ASSERT_EQ('0', buf[1]); in TEST()
957 ASSERT_EQ('1', buf[2]); in TEST()
958 ASSERT_EQ('2', buf[3]); in TEST()
959 ASSERT_EQ('3', buf[4]); in TEST()
960 ASSERT_EQ('4', buf[5]); in TEST()
961 ASSERT_EQ('5', buf[6]); in TEST()
962 ASSERT_EQ('6', buf[7]); in TEST()
963 ASSERT_EQ('7', buf[8]); in TEST()
964 ASSERT_EQ('\0', buf[9]); in TEST()
970 char buf[10]; in TEST() local
971 char* res = __stpcpy_chk(buf, "012345678", (size_t)-1); in TEST()
972 ASSERT_EQ(buf + strlen("012345678"), res); in TEST()
973 ASSERT_STREQ("012345678", buf); in TEST()
979 char buf[10]; in TEST() local
980 char* res = __strcpy_chk(buf, "012345678", (size_t)-1); in TEST()
981 ASSERT_EQ(buf, res); in TEST()
982 ASSERT_STREQ("012345678", buf); in TEST()
988 char buf[10]; in TEST() local
989 void* res = __memcpy_chk(buf, "012345678", sizeof(buf), (size_t)-1); in TEST()
990 ASSERT_EQ((void*)buf, res); in TEST()
991 ASSERT_EQ('0', buf[0]); in TEST()
992 ASSERT_EQ('1', buf[1]); in TEST()
993 ASSERT_EQ('2', buf[2]); in TEST()
994 ASSERT_EQ('3', buf[3]); in TEST()
995 ASSERT_EQ('4', buf[4]); in TEST()
996 ASSERT_EQ('5', buf[5]); in TEST()
997 ASSERT_EQ('6', buf[6]); in TEST()
998 ASSERT_EQ('7', buf[7]); in TEST()
999 ASSERT_EQ('8', buf[8]); in TEST()
1000 ASSERT_EQ('\0', buf[9]); in TEST()
1010 char buf[BUFSIZ]; in TEST() local
1011 snprintf(BUF_AND_SIZE(buf), CONTENTS); in TEST()
1012 EXPECT_STREQ(CONTENTS, buf); in TEST()
1014 snprintf(BUF_AND_SIZE_AND_CONTENTS(buf)); in TEST()
1015 EXPECT_STREQ(CONTENTS, buf); in TEST()
1017 sprintf(BUF_AND_CONTENTS(buf)); in TEST()
1018 EXPECT_STREQ(CONTENTS, buf); in TEST()
1023 pollfd buf[1] = {{0, POLLIN, 0}}; in TEST_F() local
1025 ASSERT_FORTIFY(poll(buf, fd_count, 0)); in TEST_F()
1030 pollfd buf[1] = {{0, POLLIN, 0}}; in TEST_F() local
1034 ASSERT_FORTIFY(ppoll(buf, fd_count, &timeout, NULL)); in TEST_F()