Thread (21 messages) 21 messages, 5 authors, 2013-04-23

Re: [PATCH 1/2] genetlink: trigger BUG_ON if a group name is too long

From: Masatake YAMATO <hidden>
Date: 2013-03-21 07:49:18

I will look at sparse whether it can capture this kind of mistake.

Masatake YAMATO

From: Ben Hutchings <redacted>
Date: Wed, 20 Mar 2013 17:32:59 +0000
On Wed, 2013-03-20 at 12:07 -0400, David Miller wrote:
quoted
From: Masatake YAMATO <redacted>
Date: Tue, 19 Mar 2013 20:47:27 +0900
quoted
Trigger BUG_ON if a group name is longer than GENL_NAMSIZ.

Signed-off-by: Masatake YAMATO <redacted>
Applied, thanks.

Although I'm disappointed that the compiler doesn't say anything about
this in the assignment.

We're assigning "char[16] = STRING" and it doesn't say anything if the
final NULL char doesn't fit into the array.
Unfortunately the C standard says this is allowed.  (Though the C++
standard says it's not!)  That doesn't mean the compiler can't warn
about it, of course.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help