empserver/src/lib/commands
Markus Armbruster a4e519c377 navigate: Fix buffer overrun for impossibly long paths taken
When a player moves more than 1023 sectors in a single navigate
command, we overrun the buffer holding the path taken.  Remote hole,
but it requires a ship that can go that far, and even a ship with
speed 1000 would need a tech level well in excess of 1000 for that.
Thus, the hole is purely theoretical for even remotely sane game
configurations.

First known version with the flaw is 4.0.0.

Fix by going back the older behavior: don't print the total path
taken, but do print what the path finder does.  Context diff of an
example:

     [0:634] Command : nav 3 6,0
     Flagship is od   oil derrick (#3)
    +Using path 'n'
      h =
     k . .
      j d
     <67.2:67.2: 6,0> h
     od   oil derrick (#3) stopped at 6,0
    -Path taken: n

This is how march works.

Removes the only use of shp_nav_one_sector()'s unusual return value 2.
Return 1 instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:53:01 +01:00
..
acce.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
add.c Update copyright notice 2014-01-02 14:33:48 +01:00
anti.c Update copyright notice 2014-01-02 14:33:48 +01:00
arm.c Update copyright notice 2014-01-02 14:33:48 +01:00
army.c Update copyright notice 2014-01-02 14:33:48 +01:00
assa.c subs: Rename lnd_delete() to lnd_put_one() 2015-01-17 15:25:24 +01:00
atta.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
bdes.c Update copyright notice 2014-01-02 14:33:48 +01:00
best.c Update copyright notice 2014-01-02 14:33:48 +01:00
boar.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
bomb.c Update copyright notice 2014-01-02 14:33:48 +01:00
brea.c Update copyright notice 2014-01-02 14:33:48 +01:00
budg.c Update copyright notice 2014-01-02 14:33:48 +01:00
buil.c build: Reword bridge next to land messages to mention the sector 2014-02-16 12:00:31 +01:00
buy.c Update copyright notice 2014-01-02 14:33:48 +01:00
capi.c Update copyright notice 2014-01-02 14:33:48 +01:00
carg.c Update copyright notice 2014-01-02 14:33:48 +01:00
cens.c Update copyright notice 2014-01-02 14:33:48 +01:00
chan.c Update copyright notice 2014-01-02 14:33:48 +01:00
coas.c Update copyright notice 2014-01-02 14:33:48 +01:00
coll.c Update copyright notice 2014-01-02 14:33:48 +01:00
comm.c Update copyright notice 2014-01-02 14:33:48 +01:00
cons.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
conv.c Update copyright notice 2014-01-02 14:33:48 +01:00
coun.c Update copyright notice 2014-01-02 14:33:48 +01:00
cuto.c Update copyright notice 2014-01-02 14:33:48 +01:00
decl.c Update copyright notice 2014-01-02 14:33:48 +01:00
deli.c Update copyright notice 2014-01-02 14:33:48 +01:00
demo.c Update copyright notice 2014-01-02 14:33:48 +01:00
desi.c Update copyright notice 2014-01-02 14:33:48 +01:00
disa.c Update copyright notice 2014-01-02 14:33:48 +01:00
dist.c commands: Trim obvious silly trailing space from output 2014-01-06 20:49:59 +01:00
drop.c Update copyright notice 2014-01-02 14:33:48 +01:00
dump.c Update copyright notice 2014-01-02 14:33:48 +01:00
echo.c Update copyright notice 2014-01-02 14:33:48 +01:00
edit.c edit: Keep missions centered on unit centered when teleporting 2014-02-16 13:19:25 +01:00
enab.c Update copyright notice 2014-01-02 14:33:48 +01:00
enli.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
expl.c Update copyright notice 2014-01-02 14:33:48 +01:00
fina.c Update copyright notice 2014-01-02 14:33:48 +01:00
flash.c Update copyright notice 2014-01-02 14:33:48 +01:00
flee.c Update copyright notice 2014-01-02 14:33:48 +01:00
fly.c Update copyright notice 2014-01-02 14:33:48 +01:00
foll.c Update copyright notice 2014-01-02 14:33:48 +01:00
forc.c Update copyright notice 2014-01-02 14:33:48 +01:00
fort.c Update copyright notice 2014-01-02 14:33:48 +01:00
give.c Clean up superfluous includes 2014-02-16 13:19:26 +01:00
grin.c Update copyright notice 2014-01-02 14:33:48 +01:00
hard.c Update copyright notice 2014-01-02 14:33:48 +01:00
head.c Update copyright notice 2014-01-02 14:33:48 +01:00
improve.c Update copyright notice 2014-01-02 14:33:48 +01:00
info.c commands: Trim obvious silly trailing space from output 2014-01-06 20:49:59 +01:00
land.c Update copyright notice 2014-01-02 14:33:48 +01:00
laun.c Update copyright notice 2014-01-02 14:33:48 +01:00
lboard.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
ldump.c Update copyright notice 2014-01-02 14:33:48 +01:00
ledg.c Update copyright notice 2014-01-02 14:33:48 +01:00
leve.c Update copyright notice 2014-01-02 14:33:48 +01:00
load.c commands: Trim obvious silly trailing space from output 2014-01-06 20:49:59 +01:00
look.c Update copyright notice 2014-01-02 14:33:48 +01:00
lost.c Update copyright notice 2014-01-02 14:33:48 +01:00
lstat.c Update copyright notice 2014-01-02 14:33:48 +01:00
lten.c Update copyright notice 2014-01-02 14:33:48 +01:00
map.c Update copyright notice 2014-01-02 14:33:48 +01:00
marc.c Update copyright notice 2014-01-02 14:33:48 +01:00
mark.c Update copyright notice 2014-01-02 14:33:48 +01:00
mfir.c Clean up extra semicolon after block 2015-02-01 16:53:00 +01:00
mine.c Update copyright notice 2014-01-02 14:33:48 +01:00
miss.c Clean up casts from union empobj_storage * to struct empobj * 2014-02-16 13:19:27 +01:00
mobq.c Update copyright notice 2014-01-02 14:33:48 +01:00
mora.c Update copyright notice 2014-01-02 14:33:48 +01:00
move.c Update copyright notice 2014-01-02 14:33:48 +01:00
name.c Update copyright notice 2014-01-02 14:33:48 +01:00
nati.c Update copyright notice 2014-01-02 14:33:48 +01:00
navi.c navigate: Fix buffer overrun for impossibly long paths taken 2015-02-01 16:53:01 +01:00
ndump.c Update copyright notice 2014-01-02 14:33:48 +01:00
new.c Update copyright notice 2014-01-02 14:33:48 +01:00
newe.c Update copyright notice 2014-01-02 14:33:48 +01:00
news.c Update copyright notice 2014-01-02 14:33:48 +01:00
nuke.c Update copyright notice 2014-01-02 14:33:48 +01:00
offe.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
orde.c commands: Trim obvious silly trailing space from output 2014-01-06 20:49:59 +01:00
orig.c Update copyright notice 2014-01-02 14:33:48 +01:00
para.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
path.c Update copyright notice 2014-01-02 14:33:48 +01:00
payo.c Update copyright notice 2014-01-02 14:33:48 +01:00
pboa.c Update copyright notice 2014-01-02 14:33:48 +01:00
pdump.c Update copyright notice 2014-01-02 14:33:48 +01:00
peek.c Update copyright notice 2014-01-02 14:33:48 +01:00
plan.c Update copyright notice 2014-01-02 14:33:48 +01:00
play.c Update copyright notice 2014-01-02 14:33:48 +01:00
powe.c Update copyright notice 2014-01-02 14:33:48 +01:00
prod.c Update copyright notice 2014-01-02 14:33:48 +01:00
pstat.c Update copyright notice 2014-01-02 14:33:48 +01:00
rada.c Update copyright notice 2014-01-02 14:33:48 +01:00
rang.c Update copyright notice 2014-01-02 14:33:48 +01:00
rea.c Update copyright notice 2014-01-02 14:33:48 +01:00
real.c Update copyright notice 2014-01-02 14:33:48 +01:00
reco.c Update copyright notice 2014-01-02 14:33:48 +01:00
reje.c Remove option TREATIES 2014-02-16 11:44:14 +01:00
rela.c Update copyright notice 2014-01-02 14:33:48 +01:00
relo.c Update copyright notice 2014-01-02 14:33:48 +01:00
repa.c Update copyright notice 2014-01-02 14:33:48 +01:00
repo.c Update copyright notice 2014-01-02 14:33:48 +01:00
rese.c Update copyright notice 2014-01-02 14:33:48 +01:00
reso.c resource: Trim unwanted trailing space from output 2014-01-06 20:49:59 +01:00
retr.c retreat: Reject invalid retreat paths 2014-02-16 13:19:26 +01:00
rout.c Update copyright notice 2014-01-02 14:33:48 +01:00
sabo.c Update copyright notice 2014-01-02 14:33:48 +01:00
sail.c Update copyright notice 2014-01-02 14:33:48 +01:00
sate.c Update copyright notice 2014-01-02 14:33:48 +01:00
scra.c build scrap: Redo 4.2.3's fix for manufacturing military 2014-02-16 11:48:34 +01:00
scut.c Update copyright notice 2014-01-02 14:33:48 +01:00
sdump.c Update copyright notice 2014-01-02 14:33:48 +01:00
sect.c Update copyright notice 2014-01-02 14:33:48 +01:00
sell.c Update copyright notice 2014-01-02 14:33:48 +01:00
set.c Update copyright notice 2014-01-02 14:33:48 +01:00
setres.c Update copyright notice 2014-01-02 14:33:48 +01:00
setsect.c Update copyright notice 2014-01-02 14:33:48 +01:00
shar.c Update copyright notice 2014-01-02 14:33:48 +01:00
shark.c Update copyright notice 2014-01-02 14:33:48 +01:00
shi.c Update copyright notice 2014-01-02 14:33:48 +01:00
shoo.c Update copyright notice 2014-01-02 14:33:48 +01:00
show.c Update copyright notice 2014-01-02 14:33:48 +01:00
shut.c Update copyright notice 2014-01-02 14:33:48 +01:00
sinf.c Update copyright notice 2014-01-02 14:33:48 +01:00
skyw.c Update copyright notice 2014-01-02 14:33:48 +01:00
sona.c Update copyright notice 2014-01-02 14:33:48 +01:00
spy.c Update copyright notice 2014-01-02 14:33:48 +01:00
sstat.c Update copyright notice 2014-01-02 14:33:48 +01:00
stoc.c Update copyright notice 2014-01-02 14:33:48 +01:00
stop.c Update copyright notice 2014-01-02 14:33:48 +01:00
stre.c Update copyright notice 2014-01-02 14:33:48 +01:00
strv.c commands: Trim obvious silly trailing space from output 2014-01-06 20:49:59 +01:00
supp.c Update copyright notice 2014-01-02 14:33:48 +01:00
surv.c nsc: Rename nstr_exec_val() to nstr_eval() and tighten contract 2015-02-01 16:52:59 +01:00
swap.c Update copyright notice 2014-01-02 14:33:48 +01:00
tele.c Update copyright notice 2014-01-02 14:33:48 +01:00
tend.c Update copyright notice 2014-01-02 14:33:48 +01:00
terr.c Update copyright notice 2014-01-02 14:33:48 +01:00
testing.c Clean up superfluous includes 2014-02-16 13:19:26 +01:00
thre.c Update copyright notice 2014-01-02 14:33:48 +01:00
togg.c Update copyright notice 2014-01-02 14:33:48 +01:00
torp.c Update copyright notice 2014-01-02 14:33:48 +01:00
trad.c Clean up extra semicolon after block 2015-02-01 16:53:00 +01:00
tran.c Update copyright notice 2014-01-02 14:33:48 +01:00
turn.c Update copyright notice 2014-01-02 14:33:48 +01:00
upda.c Update copyright notice 2014-01-02 14:33:48 +01:00
upgr.c Update copyright notice 2014-01-02 14:33:48 +01:00
vers.c Update copyright notice 2014-01-02 14:33:48 +01:00
wing.c Update copyright notice 2014-01-02 14:33:48 +01:00
wipe.c Update copyright notice 2014-01-02 14:33:48 +01:00
work.c Update copyright notice 2014-01-02 14:33:48 +01:00
xdump.c file: Provide EF_WITH_CADEF_MAX_ENTRY_SIZE to clean up xditem() 2015-02-01 16:52:59 +01:00
zdon.c Update copyright notice 2014-01-02 14:33:48 +01:00