diff options
| author | root <root@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-25 01:11:39 +0000 |
|---|---|---|
| committer | root <root@abc39116-655e-4be6-ad55-d661dc543056> | 2008-07-25 01:11:39 +0000 |
| commit | b163757a47d525019cebae8e1ecb843a49a14196 (patch) | |
| tree | afa580163c0c66401fe5e0db80ea61dfa8182ede /catsprintf.h | |
| parent | 9483c94352b0182580972e7cac2ba585022398d5 (diff) | |
| download | python-dmidecode-b163757a47d525019cebae8e1ecb843a49a14196.tar.gz python-dmidecode-b163757a47d525019cebae8e1ecb843a49a14196.tar.xz python-dmidecode-b163757a47d525019cebae8e1ecb843a49a14196.zip | |
This was the culprit causing the `Abort' crash, valgrind showed that this file
is where the error lied. Stephen Darragh discovered this, and the fix has been
to use vsnprintf() and not vsprintf(), which should have been the case to begin
with really.
git-svn-id: svn://svn.autonomy.net.au/python-dmidecode@18 abc39116-655e-4be6-ad55-d661dc543056
Diffstat (limited to 'catsprintf.h')
| -rw-r--r-- | catsprintf.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/catsprintf.h b/catsprintf.h index b4060e6..bab2e2c 100644 --- a/catsprintf.h +++ b/catsprintf.h @@ -9,6 +9,8 @@ #include <stdlib.h> #include <assert.h> +#define MAXVAL 1024 + typedef struct _dmi_codes_major { const unsigned short code; const char *id; @@ -19,7 +21,7 @@ typedef struct _dmi_minor { long id; dmi_codes_major* major; char *key; - char value[512]; + char value[MAXVAL]; struct _dmi_minor* next; } dmi_minor; |
