linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #01680
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2195: Prevent potential re-hashing (thanks vasily.n)
------------------------------------------------------------
revno: 2195
committer: poy <poy@xxxxxxxxxx>
branch nick: repo
timestamp: Sat 2010-08-07 17:20:27 +0200
message:
Prevent potential re-hashing (thanks vasily.n)
modified:
changelog.txt
dcpp/File.cpp
win32/AboutDlg.cpp
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'changelog.txt'
--- changelog.txt 2010-08-07 13:27:45 +0000
+++ changelog.txt 2010-08-07 15:20:27 +0000
@@ -5,6 +5,8 @@
* Enable Data Execution Prevention (cologic)
* Improved tabs, new settings (poy)
* [L#571546] Add an "X" icon to close the active tab (poy)
+* [L#603071] Linux compile fix (thanks netcelli)
+* [L#606435] Prevent potential re-hashing (thanks vasily.n)
-- 0.770 2010-07-05 --
* [L#550300] Catch more potential file corruptions (thanks bigmuscle)
=== modified file 'dcpp/File.cpp'
--- dcpp/File.cpp 2010-08-07 15:06:12 +0000
+++ dcpp/File.cpp 2010-08-07 15:20:27 +0000
@@ -60,11 +60,12 @@
SYSTEMTIME s = { 1970, 1, 0, 1, 0, 0, 0, 0 };
FILETIME f2 = {0};
if(::SystemTimeToFileTime(&s, &f2)) {
- uint64_t* a = (uint64_t*)f;
- uint64_t* b = (uint64_t*)&f2;
- *a -= *b;
- *a /= (1000LL*1000LL*1000LL/100LL); // 100ns > s
- return (uint32_t)*a;
+ ULARGE_INTEGER a,b;
+ a.LowPart =f->dwLowDateTime;
+ a.HighPart=f->dwHighDateTime;
+ b.LowPart =f2.dwLowDateTime;
+ b.HighPart=f2.dwHighDateTime;
+ return (a.QuadPart - b.QuadPart) / (10000000LL); // 100ns > s
}
return 0;
}
=== modified file 'win32/AboutDlg.cpp'
--- win32/AboutDlg.cpp 2010-07-10 14:36:48 +0000
+++ win32/AboutDlg.cpp 2010-08-07 15:20:27 +0000
@@ -45,7 +45,7 @@
"krzysztof tyszecki, poison, mikejj, pur, bigmuscle, martin, jove, bart vullings, "
"steven sheehy, tobias nygren, poy, dorian, stephan hohe, mafa_45, mikael eman, james ross, "
"stanislav maslovski, david grundberg, pavel andreev, yakov suraev, kulmegil, smir, emtee, individ, "
-"pseudonym, crise, ben, ximin luo, radox, razzloss, andrew browne, darkklor. "
+"pseudonym, crise, ben, ximin luo, radox, razzloss, andrew browne, darkklor, vasily.n, netcelli. "
"Keep it coming!";
AboutDlg::AboutDlg(dwt::Widget* parent) :