diff --git a/src/bro.bif b/src/bro.bif index 76fe5f6fa7..8dad05b24d 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -2716,8 +2716,9 @@ function bytestring_to_double%(s: string%): double return new Val(0.0, TYPE_DOUBLE); } - double d = ntohd( *(double *)s->Bytes() ); - return new Val(d, TYPE_DOUBLE); + double d; + memcpy(&d, s->Bytes(), sizeof(double)); + return new Val(ntohd(d), TYPE_DOUBLE); %} ## Converts a reverse pointer name to an address. For example,