lkml.org 
[lkml]   [1996]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectBug: ax25_getsockopt missing cast
Hello hackers,

I was reading the getsockopt functions and I noticed a missing cast
in ax25_getsockopt (version 2.1.8):

static int ax25_getsockopt(struct socket *sock, int level, int optname,
char *optval, int *optlen)
{
int val = 0;
...
put_user(val, optval);
}

Because optval is a 'char *', this is going to write only one byte into
user space, leaving the other bytes uninitialized. This is probably wrong;
I think this shold be:

put_user(val, (int *) optval);

'atalk_getsockopt' has the same bug. All the other getsockopt's are OK;
they have the cast to (int *).

Michael Chastain
mec@shout.net


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.032 / U:6.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site