prs_uint32 applied to pointers?

Mikhail T. mi+metlife at aldan.algebra.com
Thu May 17 13:46:59 GMT 2007


David Collier-Brown wrote:
>> The way things are now, it could be getting it wrong every once in a 
>> while, when the lower 32-bits of the pointer happen to be zeros. :-( 
>> How about:
>>
>>     uni_p = (fl3->path != NULL);
>>
>  That should work, even for the famous brain-dead Honeywell GCOS 6 MOD 
> 400 (;-))
Ok, the broken statement occurs in two places (do build with -Werror!).
Here is the patch (mind the space/tab mangling):

--- source/rpc_parse/parse_srv.c   Tue Mar 20 18:25:39 2007
+++ source/rpc_parse/parse_srv.c   Thu May 17 09:41:19 2007
@@ -2405,5 +2405,5 @@
                return False;

-       uni_p = fl3->path ? (uint32)fl3->path : 0;
+       uni_p = fl3->path != NULL;
        if(!prs_uint32("ptr", ps, depth, &uni_p))
                return False;
@@ -2414,5 +2414,5 @@
        }

-       uni_p = fl3->user ? (uint32)fl3->user : 0;
+       uni_p = fl3->path != NULL;
        if(!prs_uint32("ptr", ps, depth, &uni_p))
                return False;


Thanks for all the advice. Yours,

    -mi


More information about the samba-technical mailing list