Lines Matching refs:buf
305 char buf[10]; in TEST_F() local
307 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
317 char buf[0]; in TEST_F() local
319 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
329 char buf[0]; in TEST_F() local
331 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
341 char buf[1]; in TEST_F() local
343 ASSERT_FORTIFY(strcpy(buf, orig)); in TEST_F()
352 char buf[10]; in TEST_F() local
353 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
354 ASSERT_FORTIFY(printf("%zd", strlen(buf))); in TEST_F()
362 char buf[10]; in TEST_F() local
363 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
364 ASSERT_FORTIFY(printf("%s", strchr(buf, 'a'))); in TEST_F()
372 char buf[10]; in TEST_F() local
373 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
374 ASSERT_FORTIFY(printf("%s", strrchr(buf, 'a'))); in TEST_F()
406 char buf[10]; in TEST_F() local
409 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf)); in TEST_F()
416 char* buf = (char *) malloc(10); in TEST_F() local
419 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf)); in TEST_F()
420 free(buf); in TEST_F()
425 char buf[5]; in TEST_F() local
426 ASSERT_FORTIFY(sprintf(buf, "aaaaa")); in TEST_F()
430 char buf[10]; in vsprintf_helper() local
435 result = vsprintf(buf, fmt, va); // should crash here in vsprintf_helper()
449 char buf[10]; in vsnprintf_helper() local
455 result = vsnprintf(buf, size, fmt, va); // should crash here in vsnprintf_helper()
469 char buf[10]; in TEST_F() local
471 strncpy(buf, "012345678", n); in TEST_F()
472 ASSERT_FORTIFY(strncat(buf, "9", n)); in TEST_F()
476 char buf[10]; in TEST_F() local
477 buf[0] = '\0'; in TEST_F()
479 ASSERT_FORTIFY(strncat(buf, "0123456789", n)); in TEST_F()
485 char buf[10]; in TEST_F() local
486 buf[0] = '\0'; in TEST_F()
487 ASSERT_FORTIFY(strcat(buf, src)); in TEST_F()
491 char buf[20]; in TEST_F() local
492 strcpy(buf, "0123456789"); in TEST_F()
494 ASSERT_FORTIFY(memmove(buf + 11, buf, n)); in TEST_F()
506 char buf[10]; in TEST_F() local
508 ASSERT_FORTIFY(memset(buf, 0, n)); in TEST_F()
551 char buf[10]; in TEST_F() local
552 memcpy(buf, "0123456789", sizeof(buf)); in TEST_F()
554 ASSERT_FORTIFY(bzero(buf, n)); in TEST_F()
564 char buf[10]; in TEST_F() local
565 ASSERT_FORTIFY(recv(0, buf, data_len, 0)); in TEST_F()
570 char buf[10] = {0}; in TEST_F() local
571 ASSERT_FORTIFY(send(0, buf, data_len, 0)); in TEST_F()
583 char buf[1]; in TEST_F() local
584 fd_set* set = (fd_set*) buf; in TEST_F()
589 char buf[1]; in TEST_F() local
591 ASSERT_FORTIFY(getcwd(buf, ct)); in TEST_F()
595 char buf[1]; in TEST_F() local
598 ASSERT_FORTIFY(pread(fd, buf, ct, 0)); in TEST_F()
603 char buf[1]; in TEST_F() local
606 ASSERT_FORTIFY(pread64(fd, buf, ct, 0)); in TEST_F()
611 char buf[1] = {0}; in TEST_F() local
614 ASSERT_FORTIFY(pwrite(fd, buf, ct, 0)); in TEST_F()
619 char buf[1] = {0}; in TEST_F() local
622 ASSERT_FORTIFY(pwrite64(fd, buf, ct, 0)); in TEST_F()
627 char buf[1]; in TEST_F() local
630 ASSERT_FORTIFY(read(fd, buf, ct)); in TEST_F()
635 char buf[1] = {0}; in TEST_F() local
638 ASSERT_EXIT(write(fd, buf, ct), testing::KilledBySignal(SIGABRT), ""); in TEST_F()
643 char buf[1]; in TEST_F() local
646 ASSERT_FORTIFY(fread(buf, 1, ct, fp)); in TEST_F()
651 char buf[1] = {0}; in TEST_F() local
654 ASSERT_FORTIFY(fwrite(buf, 1, ct, fp)); in TEST_F()
659 char buf[1]; in TEST_F() local
661 ASSERT_FORTIFY(readlink("/dev/null", buf, ct)); in TEST_F()
665 char buf[1]; in TEST_F() local
667 ASSERT_FORTIFY(readlinkat(AT_FDCWD, "/dev/null", buf, ct)); in TEST_F()
674 char buf[10]; in TEST() local
675 memset(buf, 'A', sizeof(buf)); in TEST()
676 buf[0] = 'a'; in TEST()
677 buf[1] = '\0'; in TEST()
678 char* res = __strncat_chk(buf, "01234", sizeof(buf) - strlen(buf) - 1, sizeof(buf)); in TEST()
679 ASSERT_EQ(buf, res); in TEST()
680 ASSERT_EQ('a', buf[0]); in TEST()
681 ASSERT_EQ('0', buf[1]); in TEST()
682 ASSERT_EQ('1', buf[2]); in TEST()
683 ASSERT_EQ('2', buf[3]); in TEST()
684 ASSERT_EQ('3', buf[4]); in TEST()
685 ASSERT_EQ('4', buf[5]); in TEST()
686 ASSERT_EQ('\0', buf[6]); in TEST()
687 ASSERT_EQ('A', buf[7]); in TEST()
688 ASSERT_EQ('A', buf[8]); in TEST()
689 ASSERT_EQ('A', buf[9]); in TEST()
693 char buf[10]; in TEST() local
694 memset(buf, 'A', sizeof(buf)); in TEST()
695 buf[0] = 'a'; in TEST()
696 buf[1] = '\0'; in TEST()
697 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf)); in TEST()
698 ASSERT_EQ(buf, res); in TEST()
699 ASSERT_EQ('a', buf[0]); in TEST()
700 ASSERT_EQ('0', buf[1]); in TEST()
701 ASSERT_EQ('1', buf[2]); in TEST()
702 ASSERT_EQ('2', buf[3]); in TEST()
703 ASSERT_EQ('3', buf[4]); in TEST()
704 ASSERT_EQ('4', buf[5]); in TEST()
705 ASSERT_EQ('\0', buf[6]); in TEST()
706 ASSERT_EQ('A', buf[7]); in TEST()
707 ASSERT_EQ('A', buf[8]); in TEST()
708 ASSERT_EQ('A', buf[9]); in TEST()
712 char buf[10]; in TEST() local
713 memset(buf, 'A', sizeof(buf)); in TEST()
714 buf[0] = '\0'; in TEST()
715 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf)); in TEST()
716 ASSERT_EQ(buf, res); in TEST()
717 ASSERT_EQ('0', buf[0]); in TEST()
718 ASSERT_EQ('1', buf[1]); in TEST()
719 ASSERT_EQ('2', buf[2]); in TEST()
720 ASSERT_EQ('3', buf[3]); in TEST()
721 ASSERT_EQ('4', buf[4]); in TEST()
722 ASSERT_EQ('\0', buf[5]); in TEST()
723 ASSERT_EQ('A', buf[6]); in TEST()
724 ASSERT_EQ('A', buf[7]); in TEST()
725 ASSERT_EQ('A', buf[8]); in TEST()
726 ASSERT_EQ('A', buf[9]); in TEST()
730 char buf[10]; in TEST() local
731 memset(buf, 'A', sizeof(buf)); in TEST()
732 buf[9] = '\0'; in TEST()
733 char* res = __strncat_chk(buf, "", 5, sizeof(buf)); in TEST()
734 ASSERT_EQ(buf, res); in TEST()
735 ASSERT_EQ('A', buf[0]); in TEST()
736 ASSERT_EQ('A', buf[1]); in TEST()
737 ASSERT_EQ('A', buf[2]); in TEST()
738 ASSERT_EQ('A', buf[3]); in TEST()
739 ASSERT_EQ('A', buf[4]); in TEST()
740 ASSERT_EQ('A', buf[5]); in TEST()
741 ASSERT_EQ('A', buf[6]); in TEST()
742 ASSERT_EQ('A', buf[7]); in TEST()
743 ASSERT_EQ('A', buf[8]); in TEST()
744 ASSERT_EQ('\0', buf[9]); in TEST()
748 char buf[10]; in TEST() local
749 memset(buf, 'A', sizeof(buf)); in TEST()
750 buf[0] = 'a'; in TEST()
751 buf[1] = '\0'; in TEST()
752 char* res = __strncat_chk(buf, "01234567", 8, sizeof(buf)); in TEST()
753 ASSERT_EQ(buf, res); in TEST()
754 ASSERT_EQ('a', buf[0]); in TEST()
755 ASSERT_EQ('0', buf[1]); in TEST()
756 ASSERT_EQ('1', buf[2]); in TEST()
757 ASSERT_EQ('2', buf[3]); in TEST()
758 ASSERT_EQ('3', buf[4]); in TEST()
759 ASSERT_EQ('4', buf[5]); in TEST()
760 ASSERT_EQ('5', buf[6]); in TEST()
761 ASSERT_EQ('6', buf[7]); in TEST()
762 ASSERT_EQ('7', buf[8]); in TEST()
763 ASSERT_EQ('\0', buf[9]); in TEST()
767 char buf[10]; in TEST() local
768 memset(buf, 'A', sizeof(buf)); in TEST()
769 buf[0] = 'a'; in TEST()
770 buf[1] = '\0'; in TEST()
771 char* res = __strncat_chk(buf, "01234567", 9, sizeof(buf)); in TEST()
772 ASSERT_EQ(buf, res); in TEST()
773 ASSERT_EQ('a', buf[0]); in TEST()
774 ASSERT_EQ('0', buf[1]); in TEST()
775 ASSERT_EQ('1', buf[2]); in TEST()
776 ASSERT_EQ('2', buf[3]); in TEST()
777 ASSERT_EQ('3', buf[4]); in TEST()
778 ASSERT_EQ('4', buf[5]); in TEST()
779 ASSERT_EQ('5', buf[6]); in TEST()
780 ASSERT_EQ('6', buf[7]); in TEST()
781 ASSERT_EQ('7', buf[8]); in TEST()
782 ASSERT_EQ('\0', buf[9]); in TEST()
787 char buf[10]; in TEST() local
788 memset(buf, 'A', sizeof(buf)); in TEST()
789 buf[0] = 'a'; in TEST()
790 buf[1] = '\0'; in TEST()
791 char* res = __strcat_chk(buf, "01234", sizeof(buf)); in TEST()
792 ASSERT_EQ(buf, res); in TEST()
793 ASSERT_EQ('a', buf[0]); in TEST()
794 ASSERT_EQ('0', buf[1]); in TEST()
795 ASSERT_EQ('1', buf[2]); in TEST()
796 ASSERT_EQ('2', buf[3]); in TEST()
797 ASSERT_EQ('3', buf[4]); in TEST()
798 ASSERT_EQ('4', buf[5]); in TEST()
799 ASSERT_EQ('\0', buf[6]); in TEST()
800 ASSERT_EQ('A', buf[7]); in TEST()
801 ASSERT_EQ('A', buf[8]); in TEST()
802 ASSERT_EQ('A', buf[9]); in TEST()
806 char buf[10]; in TEST() local
807 memset(buf, 'A', sizeof(buf)); in TEST()
808 buf[0] = 'a'; in TEST()
809 buf[1] = '\0'; in TEST()
810 char* res = __strcat_chk(buf, "01234567", sizeof(buf)); in TEST()
811 ASSERT_EQ(buf, res); in TEST()
812 ASSERT_EQ('a', buf[0]); in TEST()
813 ASSERT_EQ('0', buf[1]); in TEST()
814 ASSERT_EQ('1', buf[2]); in TEST()
815 ASSERT_EQ('2', buf[3]); in TEST()
816 ASSERT_EQ('3', buf[4]); in TEST()
817 ASSERT_EQ('4', buf[5]); in TEST()
818 ASSERT_EQ('5', buf[6]); in TEST()
819 ASSERT_EQ('6', buf[7]); in TEST()
820 ASSERT_EQ('7', buf[8]); in TEST()
821 ASSERT_EQ('\0', buf[9]); in TEST()
903 char buf[10]; in TEST() local
904 memset(buf, 'A', sizeof(buf)); in TEST()
905 buf[0] = 'a'; in TEST()
906 buf[1] = '\0'; in TEST()
907 char* res = __strcat_chk(buf, "01234567", (size_t)-1); in TEST()
908 ASSERT_EQ(buf, res); in TEST()
909 ASSERT_EQ('a', buf[0]); in TEST()
910 ASSERT_EQ('0', buf[1]); in TEST()
911 ASSERT_EQ('1', buf[2]); in TEST()
912 ASSERT_EQ('2', buf[3]); in TEST()
913 ASSERT_EQ('3', buf[4]); in TEST()
914 ASSERT_EQ('4', buf[5]); in TEST()
915 ASSERT_EQ('5', buf[6]); in TEST()
916 ASSERT_EQ('6', buf[7]); in TEST()
917 ASSERT_EQ('7', buf[8]); in TEST()
918 ASSERT_EQ('\0', buf[9]); in TEST()
942 char buf[10]; in TEST() local
943 char* res = __stpcpy_chk(buf, "012345678", (size_t)-1); in TEST()
944 ASSERT_EQ(buf + strlen("012345678"), res); in TEST()
945 ASSERT_STREQ("012345678", buf); in TEST()
951 char buf[10]; in TEST() local
952 char* res = __strcpy_chk(buf, "012345678", (size_t)-1); in TEST()
953 ASSERT_EQ(buf, res); in TEST()
954 ASSERT_STREQ("012345678", buf); in TEST()
960 char buf[10]; in TEST() local
961 void* res = __memcpy_chk(buf, "012345678", sizeof(buf), (size_t)-1); in TEST()
962 ASSERT_EQ((void*)buf, res); in TEST()
963 ASSERT_EQ('0', buf[0]); in TEST()
964 ASSERT_EQ('1', buf[1]); in TEST()
965 ASSERT_EQ('2', buf[2]); in TEST()
966 ASSERT_EQ('3', buf[3]); in TEST()
967 ASSERT_EQ('4', buf[4]); in TEST()
968 ASSERT_EQ('5', buf[5]); in TEST()
969 ASSERT_EQ('6', buf[6]); in TEST()
970 ASSERT_EQ('7', buf[7]); in TEST()
971 ASSERT_EQ('8', buf[8]); in TEST()
972 ASSERT_EQ('\0', buf[9]); in TEST()
982 char buf[BUFSIZ]; in TEST() local
983 snprintf(BUF_AND_SIZE(buf), CONTENTS); in TEST()
984 EXPECT_STREQ(CONTENTS, buf); in TEST()
986 snprintf(BUF_AND_SIZE_AND_CONTENTS(buf)); in TEST()
987 EXPECT_STREQ(CONTENTS, buf); in TEST()
989 sprintf(BUF_AND_CONTENTS(buf)); in TEST()
990 EXPECT_STREQ(CONTENTS, buf); in TEST()
995 pollfd buf[1] = {{0, POLLIN, 0}}; in TEST_F() local
997 ASSERT_FORTIFY(poll(buf, fd_count, 0)); in TEST_F()
1002 pollfd buf[1] = {{0, POLLIN, 0}}; in TEST_F() local
1006 ASSERT_FORTIFY(ppoll(buf, fd_count, &timeout, nullptr)); in TEST_F()
1012 pollfd buf[1] = {{0, POLLIN, 0}}; in TEST_F() local
1016 ASSERT_FORTIFY(ppoll64(buf, fd_count, &timeout, nullptr)); in TEST_F()