On Sun, May 06, 2001 at 10:04:12PM -0400, Roland McGrath wrote:
> > Now, we actually leak all these urefs (for example, when calling
> > gettimeofday). Even for a process calling mach_host_self() 1000 times a
> > second it would take 50 days to overflow. For purity, should we deallocate
> > the port?
[...]
> Yes, that's appropriate.  It's probably just been omitted out of habit
> because of the similarity to mach_task_self, which is a macro that doesn't
> in fact add another uref.

Yup.  I will work out a patch.

While I am looking at stupid little omissions that don't make a real
difference: In proc/host.c we call host_kernel_version and use the result
without making sure it is actually null terminated. The kernel uses strncpy
to copy out the string.  Should the kernel put

out_version[MAX_KERNEL_VERSION - 1] = '\0';

or should proc do this, or should proc allocated MAX_KERNEL_VERSION + 1 and
set kv[KERNEL_VERSION_MAX] to '\0', to save the last character?

I mainly want to know what the correct approach to fix this is.  We don't
have such long version numbers, but sometimes there is a similar situation
to this.

Thanks,
Marcus


-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

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

Reply via email to