Lines Matching refs:buf
363 char buf[10];
365 ASSERT_FORTIFY(strcpy(buf, orig));
375 char buf[0];
377 ASSERT_FORTIFY(strcpy(buf, orig));
387 char buf[0];
389 ASSERT_FORTIFY(strcpy(buf, orig));
399 char buf[1];
401 ASSERT_FORTIFY(strcpy(buf, orig));
410 char buf[10];
411 memcpy(buf, "0123456789", sizeof(buf));
412 ASSERT_FORTIFY(printf("%zd", strlen(buf)));
420 char buf[10];
421 memcpy(buf, "0123456789", sizeof(buf));
422 ASSERT_FORTIFY(printf("%s", strchr(buf, 'a')));
430 char buf[10];
431 memcpy(buf, "0123456789", sizeof(buf));
432 ASSERT_FORTIFY(printf("%s", strrchr(buf, 'a')));
464 char buf[10];
467 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf));
474 char* buf = (char *) malloc(10);
477 ASSERT_FORTIFY(sprintf(buf, "%s", source_buf));
478 free(buf);
483 char buf[5];
484 ASSERT_FORTIFY(sprintf(buf, "aaaaa"));
488 char buf[10];
493 result = vsprintf(buf, fmt, va); // should crash here
507 char buf[10];
513 result = vsnprintf(buf, size, fmt, va); // should crash here
527 char buf[10];
529 strncpy(buf, "012345678", n);
530 ASSERT_FORTIFY(strncat(buf, "9", n));
534 char buf[10];
535 buf[0] = '\0';
537 ASSERT_FORTIFY(strncat(buf, "0123456789", n));
543 char buf[10];
544 buf[0] = '\0';
545 ASSERT_FORTIFY(strcat(buf, src));
549 char buf[20];
550 strcpy(buf, "0123456789");
552 ASSERT_FORTIFY(memmove(buf + 11, buf, n));
564 char buf[10];
566 ASSERT_FORTIFY(memset(buf, 0, n));
609 char buf[10];
610 memcpy(bufbuf));
612 ASSERT_FORTIFY(bzero(buf, n));
622 char buf[10];
623 ASSERT_FORTIFY(recv(0, buf, data_len, 0));
628 char buf[10] = {0};
629 ASSERT_FORTIFY(send(0, buf, data_len, 0));
641 char buf[1];
642 fd_set* set = (fd_set*) buf;
647 char buf[1];
649 ASSERT_FORTIFY(getcwd(buf, ct));
653 char buf[1];
656 ASSERT_FORTIFY(pread(fd, buf, ct, 0));
661 char buf[1];
664 ASSERT_FORTIFY(pread64(fd, buf, ct, 0));
669 char buf[1] = {0};
672 ASSERT_FORTIFY(pwrite(fd, buf, ct, 0));
677 char buf[1] = {0};
680 ASSERT_FORTIFY(pwrite64(fd, buf, ct, 0));
685 char buf[1];
688 ASSERT_FORTIFY(read(fd, buf, ct));
693 char buf[1] = {0};
696 ASSERT_EXIT(write(fd, buf, ct), testing::KilledBySignal(SIGABRT), "");
701 char buf[1];
704 ASSERT_FORTIFY(fread(buf, 1, ct, fp));
709 char buf[1] = {0};
712 ASSERT_FORTIFY(fwrite(buf, 1, ct, fp));
717 char buf[1];
719 ASSERT_FORTIFY(readlink("/dev/null", buf, ct));
723 char buf[1];
725 ASSERT_FORTIFY(readlinkat(AT_FDCWD, "/dev/null", buf, ct));
732 char buf[10];
733 memset(buf, 'A', sizeof(buf));
734 buf[0] = 'a';
735 buf[1] = '\0';
736 char* res = __strncat_chk(buf, "01234", sizeof(buf) - strlen(buf) - 1, sizeof(buf));
737 ASSERT_EQ(buf, res);
738 ASSERT_EQ('a', buf[0]);
739 ASSERT_EQ('0', buf[1]);
740 ASSERT_EQ('1', buf[2]);
741 ASSERT_EQ('2', buf[3]);
742 ASSERT_EQ('3', buf[4]);
743 ASSERT_EQ('4', buf[5]);
744 ASSERT_EQ('\0', buf[6]);
745 ASSERT_EQ('A', buf[7]);
746 ASSERT_EQ('A', buf[8]);
747 ASSERT_EQ('A', buf[9]);
751 char buf[10];
752 memset(buf, 'A', sizeof(buf));
753 buf[0] = 'a';
754 buf[1] = '\0';
755 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf));
756 ASSERT_EQ(buf, res);
757 ASSERT_EQ('a', buf[0]);
758 ASSERT_EQ('0', buf[1]);
759 ASSERT_EQ('1', buf[2]);
760 ASSERT_EQ('2', buf[3]);
761 ASSERT_EQ('3', buf[4]);
762 ASSERT_EQ('4', buf[5]);
763 ASSERT_EQ('\0', buf[6]);
764 ASSERT_EQ('A', buf[7]);
765 ASSERT_EQ('A', buf[8]);
766 ASSERT_EQ('A', buf[9]);
770 char buf[10];
771 memset(buf, 'A', sizeof(buf));
772 buf[0] = '\0';
773 char* res = __strncat_chk(buf, "0123456789", 5, sizeof(buf));
774 ASSERT_EQ(buf, res);
775 ASSERT_EQ('0', buf[0]);
776 ASSERT_EQ('1', buf[1]);
777 ASSERT_EQ('2', buf[2]);
778 ASSERT_EQ('3', buf[3]);
779 ASSERT_EQ('4', buf[4]);
780 ASSERT_EQ('\0', buf[5]);
781 ASSERT_EQ('A', buf[6]);
782 ASSERT_EQ('A', buf[7]);
783 ASSERT_EQ('A', buf[8]);
784 ASSERT_EQ('A', buf[9]);
788 char buf[10];
789 memset(buf, 'A', sizeof(buf));
790 buf[9] = '\0';
791 char* res = __strncat_chk(buf, "", 5, sizeof(buf));
792 ASSERT_EQ(buf, res);
793 ASSERT_EQ('A', buf[0]);
794 ASSERT_EQ('A', buf[1]);
795 ASSERT_EQ('A', buf[2]);
796 ASSERT_EQ('A', buf[3]);
797 ASSERT_EQ('A', buf[4]);
798 ASSERT_EQ('A', buf[5]);
799 ASSERT_EQ('A', buf[6]);
800 ASSERT_EQ('A', buf[7]);
801 ASSERT_EQ('A', buf[8]);
802 ASSERT_EQ('\0', buf[9]);
806 char buf[10];
807 memset(buf, 'A', sizeof(buf));
808 buf[0] = 'a';
809 buf[1] = '\0';
810 char* res = __strncat_chk(buf, "01234567", 8, sizeof(buf));
811 ASSERT_EQ(buf, res);
812 ASSERT_EQ('a', buf[0]);
813 ASSERT_EQ('0', buf[1]);
814 ASSERT_EQ('1', buf[2]);
815 ASSERT_EQ('2', buf[3]);
816 ASSERT_EQ('3', buf[4]);
817 ASSERT_EQ('4', buf[5]);
818 ASSERT_EQ('5', buf[6]);
819 ASSERT_EQ('6', buf[7]);
820 ASSERT_EQ('7', buf[8]);
821 ASSERT_EQ('\0', buf[9]);
825 char buf[10];
826 memset(buf, 'A', sizeof(buf));
827 buf[0] = 'a';
828 buf[1] = '\0';
829 char* res = __strncat_chk(buf, "01234567", 9, sizeof(buf));
830 ASSERT_EQ(buf, res);
831 ASSERT_EQ('a', buf[0]);
832 ASSERT_EQ('0', buf[1]);
833 ASSERT_EQ('1', buf[2]);
834 ASSERT_EQ('2', buf[3]);
835 ASSERT_EQ('3', buf[4]);
836 ASSERT_EQ('4', buf[5]);
837 ASSERT_EQ('5', buf[6]);
838 ASSERT_EQ('6', buf[7]);
839 ASSERT_EQ('7', buf[8]);
840 ASSERT_EQ('\0', buf[9]);
845 char buf[10];
846 memset(buf, 'A', sizeof(buf));
847 buf[0] = 'a';
848 buf[1] = '\0';
849 char* res = __strcat_chk(buf, "01234", sizeof(buf));
850 ASSERT_EQ(buf, res);
851 ASSERT_EQ('a', buf[0]);
852 ASSERT_EQ('0', buf[1]);
853 ASSERT_EQ('1', buf[2]);
854 ASSERT_EQ('2', buf[3]);
855 ASSERT_EQ('3', buf[4]);
856 ASSERT_EQ('4', buf[5]);
857 ASSERT_EQ('\0', buf[6]);
858 ASSERT_EQ('A', buf[7]);
859 ASSERT_EQ('A', buf[8]);
860 ASSERT_EQ('A', buf[9]);
864 char buf[10];
865 memset(buf, 'A', sizeof(buf));
866 buf[0] = 'a';
867 buf[1] = '\0';
868 char* res = __strcat_chk(buf, "01234567", sizeof(buf));
869 ASSERT_EQ(buf, res);
870 ASSERT_EQ('a', buf[0]);
871 ASSERT_EQ('0', buf[1]);
872 ASSERT_EQ('1', buf[2]);
873 ASSERT_EQ('2', buf[3]);
874 ASSERT_EQ('3', buf[4]);
875 ASSERT_EQ('4', buf[5]);
876 ASSERT_EQ('5', buf[6]);
877 ASSERT_EQ('6', buf[7]);
878 ASSERT_EQ('7', buf[8]);
879 ASSERT_EQ('\0', buf[9]);
961 char buf[10];
962 memset(buf, 'A', sizeof(buf));
963 buf[0] = 'a';
964 buf[1] = '\0';
965 char* res = __strcat_chk(buf, "01234567", (size_t)-1);
966 ASSERT_EQ(buf, res);
967 ASSERT_EQ('a', buf[0]);
968 ASSERT_EQ('0', buf[1]);
969 ASSERT_EQ('1', buf[2]);
970 ASSERT_EQ('2', buf[3]);
971 ASSERT_EQ('3', buf[4]);
972 ASSERT_EQ('4', buf[5]);
973 ASSERT_EQ('5', buf[6]);
974 ASSERT_EQ('6', buf[7]);
975 ASSERT_EQ('7', buf[8]);
976 ASSERT_EQ('\0', buf[9]);
982 char buf[10];
983 char* res = __stpcpy_chk(buf, "012345678", (size_t)-1);
984 ASSERT_EQ(buf + strlen("012345678"), res);
985 ASSERT_STREQ("012345678", buf);
991 char buf[10];
992 char* res = __strcpy_chk(buf, "012345678", (size_t)-1);
993 ASSERT_EQ(buf, res);
994 ASSERT_STREQ("012345678", buf);
1000 char buf[10];
1001 void* res = __memcpy_chk(buf, "012345678", sizeof(buf), (size_t)-1);
1002 ASSERT_EQ((void*)buf, res);
1003 ASSERT_EQ('0', buf[0]);
1004 ASSERT_EQ('1', buf[1]);
1005 ASSERT_EQ('2', buf[2]);
1006 ASSERT_EQ('3', buf[3]);
1007 ASSERT_EQ('4', buf[4]);
1008 ASSERT_EQ('5', buf[5]);
1009 ASSERT_EQ('6', buf[6]);
1010 ASSERT_EQ('7', buf[7]);
1011 ASSERT_EQ('8', buf[8]);
1012 ASSERT_EQ('\0', buf[9]);
1022 char buf[BUFSIZ];
1023 snprintf(BUF_AND_SIZE(buf), CONTENTS);
1024 EXPECT_STREQ(CONTENTS, buf);
1026 snprintf(BUF_AND_SIZE_AND_CONTENTS(buf));
1027 EXPECT_STREQ(CONTENTS, buf);
1029 sprintf(BUF_AND_CONTENTS(buf));
1030 EXPECT_STREQ(CONTENTS, buf);
1035 pollfd buf[1] = {{0, POLLIN, 0}};
1037 ASSERT_FORTIFY(poll(buf, fd_count, 0));
1042 pollfd buf[1] = {{0, POLLIN, 0}};
1046 ASSERT_FORTIFY(ppoll(buf, fd_count, &timeout, NULL));