diff options
author | David Sommerseth <davids@redhat.com> | 2009-06-09 17:38:10 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-06-09 17:38:10 +0200 |
commit | 8e3054ace87b7b91f9c4f4cbfede331901caecaa (patch) | |
tree | ce0a98856f290b4292acee9d0e4c1840fe4afe2c /src/dmidecodemodule.c | |
parent | 0d99e20115f56a3f7a0b56ada60662c51a5e1314 (diff) | |
download | python-dmidecode-8e3054ace87b7b91f9c4f4cbfede331901caecaa.tar.gz python-dmidecode-8e3054ace87b7b91f9c4f4cbfede331901caecaa.tar.xz python-dmidecode-8e3054ace87b7b91f9c4f4cbfede331901caecaa.zip |
Fixed SEGV when setting new devive file
Diffstat (limited to 'src/dmidecodemodule.c')
-rw-r--r-- | src/dmidecodemodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |