From 8e3054ace87b7b91f9c4f4cbfede331901caecaa Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Tue, 9 Jun 2009 17:38:10 +0200 Subject: Fixed SEGV when setting new devive file --- src/dmidecodemodule.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dmidecodemodule.c') diff --git a/src/dmidecodemodule.c b/src/dmidecodemodule.c index fdef4ad..0e2ff10 100644 --- a/src/dmidecodemodule.c +++ b/src/dmidecodemodule.c @@ -462,7 +462,8 @@ static PyObject *dmidecode_get_type(PyObject * self, PyObject * args) if( (typeid >= 0) && (typeid < 256) ) { pydata = dmidecode_get_typeid(global_options, typeid); } else { - snprintf(msg, 8192, "Types are bound between 0 and 255 (inclusive)%c", 0); + snprintf(msg, 8192, "Types are bound between 0 and 255 (inclusive)." + "Type value used was '%i'%c", typeid, 0); pydata = NULL; } } else { @@ -505,7 +506,8 @@ static PyObject *dmidecode_set_dev(PyObject * self, PyObject * arg) struct stat buf; char *f = PyString_AsString(arg); - if( (f != NULL) && (strcmp(global_options->dumpfile, f) == 0) ) { + if( (f != NULL) && (global_options->dumpfile != NULL ) + && (strcmp(global_options->dumpfile, f) == 0) ) { Py_RETURN_TRUE; } -- cgit