Re: NGINX 1.0.3 compile error: src/core/ngx_crypt.c: In function ‘ngx_crypt_apr1’

Igor Sysoev igor at sysoev.ru
Fri May 27 13:57:45 MSD 2011


On Fri, May 27, 2011 at 11:30:17AM +0200, Dalibor Jotanovic wrote:
> Hi,
>  
> i'm having problems compiling the latest stable source 1.0.3.
>  
> How to reproduce:
>  
> cd <sourcedirectory>
> ./configure
> make
>  
> make output is attached in log.txt
>  
> I do not have any problems compiling stable source 1.0.2
>  
> Is suspect this issue beeing a bug. Can somebody confirm this?

> gcc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Wunused-function -Wunused-variable -Wunused-value -Werror -g  -I src/core -I 
> src/event -I src/event/modules -I src/os/unix -I objs \
> 		-o objs/src/core/ngx_crypt.o \
> 		src/core/ngx_crypt.c
> cc1: warnings being treated as errors
> src/core/ngx_crypt.c: In function Б─≤ngx_crypt_apr1Б─≥:
> src/core/ngx_crypt.c:76: warning: pointer targets in passing argument 2 of Б─≤ngx_md5_updateБ─≥ differ in signedness

Thank you for the report.
The attached patch should fix the issue.


-- 
Igor Sysoev
-------------- next part --------------
Index: src/core/ngx_md5.c
===================================================================
--- src/core/ngx_md5.c	(revision 3927)
+++ src/core/ngx_md5.c	(working copy)
@@ -32,7 +32,7 @@
 
 
 void
-ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size)
+ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size)
 {
     size_t  used, free;
 
@@ -47,8 +47,7 @@
             return;
         }
 
-        ngx_memcpy(&ctx->buffer[used], data, free);
-        data = (u_char *)data + free;
+        data = ngx_cpymem(&ctx->buffer[used], data, free);
         size -= free;
         (void) ngx_md5_body(ctx, ctx->buffer, 64);
     }
Index: src/core/ngx_md5.h
===================================================================
--- src/core/ngx_md5.h	(revision 3927)
+++ src/core/ngx_md5.h	(working copy)
@@ -50,7 +50,7 @@
 
 
 void ngx_md5_init(ngx_md5_t *ctx);
-void ngx_md5_update(ngx_md5_t *ctx, const u_char *data, size_t size);
+void ngx_md5_update(ngx_md5_t *ctx, const void *data, size_t size);
 void ngx_md5_final(u_char result[16], ngx_md5_t *ctx);
 
 


More information about the nginx mailing list