Find bug in dns resovle


#1

in function ngx_resolver_copy ,n = (n & 0x3f << 8) + *p;
should be n = ((n & 0x3f) << 8) + *p;otherwis ,& oprator will not work
correctlly.

thanks


#2

On Mon, Nov 17, 2008 at 10:20:34AM +0800, removed_email_address@domain.invalid wrote:

in function ngx_resolver_copy ,n = (n & 0x3f << 8) + *p;
should be n = ((n & 0x3f) << 8) + *p;otherwis ,& oprator will not work correctlly.

Thank you very much.
I had missed it as it becomes apparent on big (>256 bytes) DNS
responses.
What is your full name to include in CHANGES log ?


#3

Igor S. wrote:

On Mon, Nov 17, 2008 at 10:20:34AM +0800, removed_email_address@domain.invalid wrote:

in function ngx_resolver_copy ,n = (n & 0x3f << 8) + *p;
should be n = ((n & 0x3f) << 8) + *p;otherwis ,& oprator will not work correctlly.

Thank you very much.
I had missed it as it becomes apparent on big (>256 bytes) DNS
responses.
What is your full name to include in CHANGES log ?

Isnt the same idea of
n = (n & 0x3f << 8) + *src;

should this be:

n = ((n & 0x3f << 8) + *src);

Sorry I might be wrong… but who knows :stuck_out_tongue:


#4

Igor S. wrote:

On Tue, Nov 18, 2008 at 10:43:32PM +0100, Robert G. wrote:

Isnt the same idea of
n = (n & 0x3f << 8) + *src;

should this be:

n = ((n & 0x3f << 8) + *src);

Sorry I might be wrong… but who knows :stuck_out_tongue:

This is the same.

Meaning should I change it in my nginx source, or not?!


#5

On Tue, Nov 18, 2008 at 10:43:32PM +0100, Robert G. wrote:

Isnt the same idea of
n = (n & 0x3f << 8) + *src;

should this be:

n = ((n & 0x3f << 8) + *src);

Sorry I might be wrong… but who knows :stuck_out_tongue:

This is the same.