Add a comment for the added cast with explanation.
authorTomas Mraz <tmraz@fedoraproject.org>
Wed, 10 Aug 2016 13:21:32 +0000 (15:21 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 15 Aug 2016 22:30:45 +0000 (23:30 +0100)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
engines/afalg/e_afalg.c

index 456ffda..1766230 100644 (file)
@@ -230,6 +230,10 @@ int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
     memset(cb, '\0', sizeof(*cb));
     cb->aio_fildes = sfd;
     cb->aio_lio_opcode = IOCB_CMD_PREAD;
+    /*
+     * The pointer has to be converted to unsigned value first to avoid
+     * sign extension on cast to 64 bit value
+     */
     cb->aio_buf = (uint64_t)(unsigned long)buf;
     cb->aio_offset = 0;
     cb->aio_data = 0;