dcantrell / pyparted

Python bindings for GNU parted (libparted)
GNU General Public License v2.0
86 stars 43 forks source link

NULL pointer dereference in pydisk.c #46

Closed badeadan closed 5 years ago

badeadan commented 6 years ago

disk is dereferenced inside an if ( disk ... == NULL ) block:

https://github.com/dcantrell/pyparted/blob/3124cb8dac886b13291711490452c375433b9a52/src/pydisk.c#L2045

https://github.com/dcantrell/pyparted/blob/3124cb8dac886b13291711490452c375433b9a52/src/pydisk.c#L2048

dcantrell commented 5 years ago

The line you are referencing where the dereference occurs is in the else clause from the first if statement, which would only execute if disk->dev is not NULL. Or do you mean somewhere else?

badeadan commented 5 years ago

It's OK, I don't remember exactly what was the issue and my comment from back then doesn't help either...

dcantrell commented 5 years ago

OK, thanks. I'll close out the issue then.