]> git.pond.sub.org Git - empserver/commit
setsector: Clean up read beyond end of string
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 24 Jan 2013 21:01:45 +0000 (22:01 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 6 Jun 2013 17:55:00 +0000 (19:55 +0200)
commitd4e9dccbccde51c83476c6600752b69974384957
tree9b6743e9ec740bd400308df34dd3eaa9fbb391da
parenta922cc9c5f3df494580792d4672e10b767e734fd
setsector: Clean up read beyond end of string

setsector() reads the first two characters unconditionally.  Wrong if
the first character is NUL.  The second character read isn't actually
used then.  Screwed up in Chainsaw.

When getstarg() returns an empty string, it's always in the buffer
passed as third argument.  Thus, reading the second character is
actually safe.

Clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/commands/setsect.c