prevent CNAME/PTR parsing from reading data past the response end
[musl] / src / complex / cacosh.c
index 8e42f1a..76127f7 100644 (file)
@@ -4,6 +4,9 @@
 
 double complex cacosh(double complex z)
 {
+       int zineg = signbit(cimag(z));
+
        z = cacos(z);
-       return CMPLX(-cimag(z), creal(z));
+       if (zineg) return CMPLX(cimag(z), -creal(z));
+       else       return CMPLX(-cimag(z), creal(z));
 }