prevent CNAME/PTR parsing from reading data past the response end
[musl] / src / stdio / fputs.c
index 4737f44..1cf344f 100644 (file)
@@ -3,7 +3,8 @@
 
 int fputs(const char *restrict s, FILE *restrict f)
 {
-       return (int)fwrite(s, strlen(s), 1, f) - 1;
+       size_t l = strlen(s);
+       return (fwrite(s, 1, l, f)==l) - 1;
 }
 
 weak_alias(fputs, fputs_unlocked);