projects
/
platform
/
upstream
/
openconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c68ec1
)
Fix select µsec calculation to avoid integer overflow.
author
David Woodhouse
<David.Woodhouse@intel.com>
Sat, 6 Dec 2008 10:32:40 +0000
(10:32 +0000)
committer
David Woodhouse
<David.Woodhouse@intel.com>
Sat, 6 Dec 2008 10:32:40 +0000
(10:32 +0000)
Pointed out by Sergey Svishchev.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
mainloop.c
patch
|
blob
|
history
diff --git
a/mainloop.c
b/mainloop.c
index
ca98f54
..
fac9ede
100644
(file)
--- a/
mainloop.c
+++ b/
mainloop.c
@@
-121,7
+121,7
@@
int vpn_mainloop(struct openconnect_info *vpninfo)
memcpy(&efds, &vpninfo->select_efds, sizeof(efds));
tv.tv_sec = timeout / 1000;
- tv.tv_usec = (timeout
* 1000) % 1000
000;
+ tv.tv_usec = (timeout
% 1000) * 1
000;
if (select(vpninfo->select_nfds, &rfds, &wfds, &efds, &tv) >= 0
&& FD_ISSET(vpninfo->ssl_fd, &efds)) {
/* OpenSSL doesn't seem to cope properly with this... */