The change in glibc commit d58ab810a6e325cc351684d174c48cabce01bcc1 (author in CC): From commit description:"[...] Also avoid an unnecessary call to strcspn after the last token by adding an early exit for an empty string.[...]" Important code change: /* Parse S into tokens separated by characters in DELIM. @@ -45,11 +41,17 @@ char * __strtok_r (char *s, const char *delim, char **save_ptr) { - char *token; + char *end; if (s == NULL) s = *save_ptr; + if (*s == '\0') + { + *save_ptr = s; + return NULL; + } + may result in the mentioned segmentation fault if the char *str passed to strtok_r is a NULL (for 1st call). Checked glibc versions: ~/git-repos/glibc:release/2.25/master$ git tag --contain=d58ab810a6e325cc351684d174c48cabce01bcc1 changelog-ends-here glibc-2.25 glibc-2.25.90 glibc-2.26 glibc-2.26.9000 glibc-2.27 glibc-2.27.9000 glibc-2.28 glibc-2.28.9000 glibc-2.29 glibc-2.29.9000 glibc-2.30 glibc-2.30.9000 glibc-2.31 glibc-2.31.9000 cheers, Marcin