[PATCH 1/2] Annotate internal_error with the attribute noreturn

2012-09-21 Thread David Bremner
Justus Winter <4winter at informatik.uni-hamburg.de> writes: > Annotating functions that do not return with the noreturn attribute > (which is understood by both gcc and clang) prevents static analyzers > from generating false positives (internal_error is used to terminate > the process and is

[PATCH 2/2] Avoid potentially dereferencing a NULL pointer

2012-09-21 Thread Justus Winter
GMIME_IS_MULTIPART and GMIME_IS_MESSAGE both handle NULL pointers gracefully, but the G_OBJECT_TYPE used in the error handling block dereferences it without checking it first. Fix this by checking whether parent->part is valid. Found using the clang static analyzer. Signed-off-by: Justus Winter

[PATCH 1/2] Annotate internal_error with the attribute noreturn

2012-09-21 Thread Justus Winter
Annotating functions that do not return with the noreturn attribute (which is understood by both gcc and clang) prevents static analyzers from generating false positives (internal_error is used to terminate the process and is used extensively in error handling code paths). Remove the return

[PATCH 2/2] Avoid potentially dereferencing a NULL pointer

2012-09-21 Thread Justus Winter
GMIME_IS_MULTIPART and GMIME_IS_MESSAGE both handle NULL pointers gracefully, but the G_OBJECT_TYPE used in the error handling block dereferences it without checking it first. Fix this by checking whether parent-part is valid. Found using the clang static analyzer. Signed-off-by: Justus Winter

Re: [PATCH 1/2] Annotate internal_error with the attribute noreturn

2012-09-21 Thread David Bremner
Justus Winter 4win...@informatik.uni-hamburg.de writes: Annotating functions that do not return with the noreturn attribute (which is understood by both gcc and clang) prevents static analyzers from generating false positives (internal_error is used to terminate the process and is used