#include #include #include #define __unlikely(x) x #define __likely(x) x extern int __VERIFIER_nondet_int(void); size_t strlen(const char *s) { register size_t i; if (__unlikely(!s)) return 0; for (i=0; __likely(*s); ++s) ++i; return i; } /* * Appends src to string dst of size siz (unlike strncat, siz is the * full size of dst, not space left). At most siz-1 characters * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(initial dst) + strlen(src); if retval >= siz, * truncation occurred. */ size_t strlcat(dst, src, siz) char *dst; const char *src; size_t siz; { register char *d = dst; register const char *s = src; register size_t n = siz; size_t dlen; /* Find the end of dst and adjust bytes left but don't go past end */ while (*d != '\0' && n-- != 0) d++; dlen = d - dst; n = siz - dlen; if (n == 0) return(dlen + strlen(s)); while (*s != '\0') { if (n != 1) { *d++ = *s; n--; } s++; } *d = '\0'; return(dlen + (s - src)); /* count does not include NUL */ } int main(){ int in_len = __VERIFIER_nondet_int(); if(in_len < 1){return 1;} char* in = alloca(in_len); in[in_len-1]=0; int out_len = __VERIFIER_nondet_int(); if(out_len < 1){return 1;} char* out = alloca(out_len); out[out_len-1]=0; return strlcat(in, out, out_len); }