Hi,

I was reading the sources of pflocal, to learn more about the Hurd
internals, when I encountered the following piece of code:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
error_t
S_socket_connect (struct sock_user *user, struct addr *addr)
{
  error_t err;
  struct sock *peer;

  if (! addr)
    return ECONNREFUSED;

  /* Deallocate ADDR's send right, which we get as a side effect of the
rpc. */
  mach_port_deallocate (mach_task_self (),
                        ((struct port_info *)addr)->port_right);

  if (! user)
    return EOPNOTSUPP;

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Why is that port deallocated _before_ user is tested for validity? Is it
unimportant? Why? I would have expected that both addr and user would be
tested before anything is done...

Snark on #hurd



_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to