[PATCH GnuPG] gpgscm: Guard use of union member.

Justus Winter justus at g10code.com
Thu Dec 22 11:46:39 CET 2016


* tests/gpgscm/scheme.c (opexe_5): Check that we have a file port
before accessing filename.  Fixes a crash on 32-bit architectures.

Fixes-commit: e7429b1ced0c69fa7901f888f8dc25f00fc346a4
Signed-off-by: Justus Winter <justus at g10code.com>
---
 tests/gpgscm/scheme.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index a5b7691fb..284454557 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -4838,7 +4838,7 @@ static pointer opexe_5(scheme *sc, enum scheme_opcodes op) {
                } else {
                     sc->nesting_stack[sc->file_i]++;
 #if USE_TAGS && SHOW_ERROR_LINE
-		    {
+		    if (sc->load_stack[sc->file_i].kind & port_file) {
 		      const char *filename =
 			sc->load_stack[sc->file_i].rep.stdio.filename;
 		      int lineno =
-- 
2.11.0




More information about the Gnupg-devel mailing list