lkml.org 
[lkml]   [1997]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectUninitialized variable
I found the following potential bug in linux/net/core/sock.c: 'err' was
never initialized, plus the code section seemed to have been 'plugged-in'
from somewhere else. It didn't follow the same logic as other entries in
the switch(). BTW. It doesn't seem to fix anything, but nobody sets
sockets to "linger" anymore, they just close 'em... Maybe "socket destroy
messages?" ..Nah. too lucky if true.
---------------------------

--- /usr/src/linux/net/core/sock.c.orig Sun Mar 2 19:43:18 1997
+++ /usr/src/linux/net/core/sock.c Sun Mar 2 19:33:22 1997
@@ -327,20 +327,14 @@
break;

case SO_LINGER:
- {
- int err;
len=min(len,sizeof(ling));
- if (put_user(len, optlen))
- if (!err) {
- ling.l_onoff=sk->linger;
- ling.l_linger=sk->lingertime;
- err = copy_to_user(optval,&ling,len);
- if (err)
- err = -EFAULT;
- }
- return err;
- }
-
+ if(put_user(len, optlen))
+ return -EFAULT;
+ ling.l_onoff=sk->linger;
+ ling.l_linger=sk->lingertime;
+ if(copy_to_user(optval,&ling,len))
+ return -EFAULT;
+ return 0;
case SO_BSDCOMPAT:
val = sk->bsdism;
break;
-----------------------------

Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.27 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


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