]> git.pond.sub.org Git - empserver/commit
Fix misuse of ef_cadef(EF_BAD)
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 Sep 2008 14:29:01 +0000 (10:29 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 4 Sep 2008 01:15:08 +0000 (21:15 -0400)
commitd929aa8b8268cb81d132a9ca570cbef2dbe0427b
tree6f235dfbc30ff8735b563c112b5cc8686c63c83a
parent50cfdcb5a745984ff42ee31efd01af46d7c00720
Fix misuse of ef_cadef(EF_BAD)

ef_elt_by_name(), xdprval_sym() and symval() checked whether a file
type T is a symbol table by comparing ef_cadef(T) to symbol_ca, even
though T may be EF_BAD.  Before commit 50cfdcb5, ef_cadef(EF_BAD)
accessed empfile[] out of bounds, which could conceivably crash or
somehow happen to yield symbol_ca.  Since then, it oopses and returns
null.

Fix by testing the file type before calling ef_cadef().
src/lib/common/type.c
src/lib/common/xdump.c
src/lib/common/xundump.c