ciniparser: Add a check that len remains within bounds.
authorAndreas Schlick <schlick@lavabit.com>
Tue, 26 Apr 2011 15:07:49 +0000 (17:07 +0200)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 27 Apr 2011 05:43:02 +0000 (15:13 +0930)
commit5c922794aa81cb2a62a034552f6478074b4dda14
tree2b723de1352d44624be1cdea3a91513bd3f2980a
parent9aa2e32a540e26d68be9b4c1dbca6a42ef0787c1
ciniparser: Add a check that len remains within bounds.

If the line is made solely of whitespaces, they get removed and we end up with len
set to -1. Therefore we need an additional check to avoid dereferencing line[-1].
ccan/ciniparser/ciniparser.c