Menu parser: added boundary checks in the path-gen for #include file search
commit9ad278ddf8c67f89574947b5f87c4e8ff5d047c5
authorChristophe CURIS <christophe.curis@free.fr>
Tue, 17 Jul 2012 22:02:22 +0000 (18 00:02 +0200)
committerCarlos R. Mafra <crmafra@gmail.com>
Thu, 19 Jul 2012 10:23:29 +0000 (19 11:23 +0100)
treea2dd478835e2fd249b771df9f87bbf9af199d566
parentac52d4de6503bd22e3393e9a26bb1447c0576ff2
Menu parser: added boundary checks in the path-gen for #include file search

When generating the full path+name of file to search for a file
being #included, it was generated in a buffer that's supposedly
large enough (MAXLINE > 2*PATH_MAX). However, this limit has a few
issues (PATH_MAX seem to be able to be bigger, and worse: we can't
be sure we're given longer args).

The code was rewrote to natively include boundary checks so we're
sure we won't overflow the buffer. A few strncpy have been removed
because in this case they tend to make things harder to write.
WINGs/menuparser.c