Lines Matching refs:from
123 char *from = Ident((char*)malloc(from_size)); in TEST() local
125 strcpy(from, "hello"); in TEST()
126 strcpy(to, from); in TEST()
127 strcpy(to + to_size - from_size, from); in TEST()
129 EXPECT_DEATH(Ident(strcpy(from, "hello2")), RightOOBWriteMessage(0)); in TEST()
131 EXPECT_DEATH(Ident(strcpy(to - 1, from)), LeftOOBWriteMessage(1)); in TEST()
132 EXPECT_DEATH(Ident(strcpy(to, from - 1)), LeftOOBReadMessage(1)); in TEST()
133 EXPECT_DEATH(Ident(strcpy(to, from + from_size)), RightOOBReadMessage(0)); in TEST()
134 EXPECT_DEATH(Ident(strcpy(to + to_size, from)), RightOOBWriteMessage(0)); in TEST()
136 from[from_size - 1] = '!'; in TEST()
137 EXPECT_DEATH(Ident(strcpy(to, from)), RightOOBReadMessage(0)); in TEST()
139 free(from); in TEST()
147 char *from = Ident((char*)malloc(from_size)); in TEST() local
148 strcpy(from, "hello"); in TEST()
150 strncpy(to, from, 0); in TEST()
151 strncpy(to - 1, from - 1, 0); in TEST()
153 strncpy(to, from, from_size); in TEST()
154 strncpy(to, from, to_size); in TEST()
155 strncpy(to, from + from_size - 1, to_size); in TEST()
156 strncpy(to + to_size - 1, from, 1); in TEST()
158 EXPECT_DEATH(Ident(strncpy(to, from - 1, from_size)), in TEST()
160 EXPECT_DEATH(Ident(strncpy(to - 1, from, from_size)), in TEST()
162 EXPECT_DEATH(Ident(strncpy(to, from + from_size, 1)), in TEST()
164 EXPECT_DEATH(Ident(strncpy(to + to_size, from, 1)), in TEST()
167 EXPECT_DEATH(Ident(strncpy(to + to_size - from_size + 1, from, from_size)), in TEST()
169 EXPECT_DEATH(Ident(strncpy(to + 1, from, to_size)), in TEST()
172 from[from_size - 1] = '!'; in TEST()
174 strncpy(to, from, from_size); in TEST()
176 EXPECT_DEATH(Ident(strncpy(to, from, to_size)), in TEST()
179 free(from); in TEST()
359 char *from = MallocAndMemsetString(from_size); in TEST() local
360 from[from_size - 1] = '\0'; in TEST()
362 strcat(to, from); in TEST()
363 strcat(to, from); in TEST()
364 strcat(to + from_size, from + from_size - 2); in TEST()
367 EXPECT_DEATH(strcat(to - 1, from + from_size - 1), LeftOOBAccessMessage(1)); in TEST()
369 EXPECT_DEATH(strcat(to - 1, from), LeftOOBAccessMessage(1)); in TEST()
370 EXPECT_DEATH(strcat(to, from - 1), LeftOOBReadMessage(1)); in TEST()
371 EXPECT_DEATH(strcat(to, from + from_size), RightOOBReadMessage(0)); in TEST()
374 from[from_size - 1] = 'z'; in TEST()
375 EXPECT_DEATH(strcat(to, from), RightOOBReadMessage(0)); in TEST()
376 from[from_size - 1] = '\0'; in TEST()
380 EXPECT_DEATH(strcat(to, from), RightOOBWriteMessage(0)); in TEST()
382 strcat(to, from + 1); in TEST()
385 free(from); in TEST()
394 char *from = MallocAndMemsetString(from_size); in TEST() local
396 strncat(to, from, 0); in TEST()
397 strncat(to, from, from_size); in TEST()
398 from[from_size - 1] = '\0'; in TEST()
399 strncat(to, from, 2 * from_size); in TEST()
401 EXPECT_DEATH(strncat(to - 1, from, 0), LeftOOBAccessMessage(1)); in TEST()
402 strncat(to, from + from_size - 1, 10); in TEST()
404 EXPECT_DEATH(strncat(to - 1, from, 2), LeftOOBAccessMessage(1)); in TEST()
405 EXPECT_DEATH(strncat(to, from - 1, 2), LeftOOBReadMessage(1)); in TEST()
406 EXPECT_DEATH(strncat(to, from + from_size, 2), RightOOBReadMessage(0)); in TEST()
408 memset(from, 'z', from_size); in TEST()
412 EXPECT_DEATH(strncat(to, from, from_size + 1), RightOOBReadMessage(0)); in TEST()
416 EXPECT_DEATH(strncat(to, from, from_size - 1), RightOOBWriteMessage(0)); in TEST()
418 strncat(to, from, from_size - 2); in TEST()
421 free(from); in TEST()