Fix segfault when reading Layer() with no name
commit4bc7ae3823b8120fdf415ee17ca7726fab5c8dcf
authorSergey Alyoshin <alyoshin.s@gmail.com>
Sat, 17 Mar 2012 20:05:09 +0000 (17 13:05 -0700)
committerAndrew Poelstra (local) <apoelstra@wpsoftware.net>
Sat, 17 Mar 2012 20:05:09 +0000 (17 13:05 -0700)
tree455b435fd944692ae54771c53fe561d3320c1e5a
parenta044f40c2618d8aadd16bd7df0ac2d4d03928bfc
Fix segfault when reading Layer() with no name

When reading pcb file with a line like

  Layer (2 "")

the lexer gives us a NULL in place of the empty string,
which caused a NULL-dereference and segfault. This patch
allocates a new "" string when reading nameless layers.

See
http://www.delorie.com/archives/browse.cgi?p=geda-user/2012/03/17/10:13:37
src/parse_y.y