Fix more overflows (CID 75145,75137,75104,75094)

https://github.com/freenet/fred/pull/312 was incomplete; Coverity has found more ...
Added #315 which includes all changes introduced in this commit, except for this whitespace changes.