Home | History | Annotate | Download | only in tests

Lines Matching defs:from_size

151   size_t from_size = Ident(6);  // less than to_size
153 char *from = Ident((char*)malloc(from_size));
157 strcpy(to + to_size - from_size, from);
163 EXPECT_DEATH(Ident(strcpy(to, from + from_size)), RightOOBReadMessage(0));
166 from[from_size - 1] = '!';
174 size_t from_size = Ident(6); // less than to_size
177 char *from = Ident((char*)malloc(from_size));
183 strncpy(to, from, from_size);
185 strncpy(to, from + from_size - 1, to_size);
188 EXPECT_DEATH(Ident(strncpy(to, from - 1, from_size)),
190 EXPECT_DEATH(Ident(strncpy(to - 1, from, from_size)),
192 EXPECT_DEATH(Ident(strncpy(to, from + from_size, 1)),
197 EXPECT_DEATH(Ident(strncpy(to + to_size - from_size + 1, from, from_size)),
202 from[from_size - 1] = '!';
204 strncpy(to, from, from_size);
381 size_t from_size = Ident(20);
382 char *from = MallocAndMemsetString(from_size);
383 from[from_size - 1] = '\0';
387 strcat(to + from_size, from + from_size - 2);
390 EXPECT_DEATH(strcat(to - 1, from + from_size - 1), LeftOOBAccessMessage(1));
394 EXPECT_DEATH(strcat(to, from + from_size), RightOOBReadMessage(0));
397 from[from_size - 1] = 'z';
399 from[from_size - 1] = '\0';
402 to[to_size - from_size + 1] = '\0';
416 size_t from_size = Ident(20);
417 char *from = MallocAndMemsetString(from_size);
420 strncat(to, from, from_size);
421 from[from_size - 1] = '\0';
422 strncat(to, from, 2 * from_size);
425 strncat(to, from + from_size - 1, 10);
429 EXPECT_DEATH(strncat(to, from + from_size, 2), RightOOBReadMessage(0));
431 memset(from, 'z', from_size);
435 EXPECT_DEATH(strncat(to, from, from_size + 1), RightOOBReadMessage(0));
438 to[to_size - from_size + 1] = '\0';
439 EXPECT_DEATH(strncat(to, from, from_size - 1), RightOOBWriteMessage(0));
441 strncat(to, from, from_size - 2);