[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ports_create_port() with bogus size?
From: |
olafBuddenhagen |
Subject: |
ports_create_port() with bogus size? |
Date: |
Mon, 12 Apr 2010 13:45:50 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
Hi,
I just noticed this bit of code in libports:
if (size < sizeof (struct port_info))
size = sizeof (struct port_info);
"size" is passed from the caller, and should describe the size of the per-port
structure; i.e. the size of the standard stuff managed by libports itself
(struct port_info), plus any additional info the user wants to store there.
The above code means that if a caller passes a bogus size, instead of screaming
loudly, it is silently ignored?! I can't see how this can be useful :-(
(I guess it *might* make sense to special-case a "0" size, if the caller simply
is not interested in any additional data -- though I'm not sure that's ever
useful. But other cases are definitely bogus.)
-antrik-
- ports_create_port() with bogus size?,
olafBuddenhagen <=