Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid null pointer dereference in grib_expression_free(). #36

Merged
merged 1 commit into from
Aug 2, 2020

Conversation

shinji-s
Copy link
Contributor

@shinji-s shinji-s commented Aug 2, 2020

It seems grib_arguments::expression can be null.

Call stack leading to the crash is as follow. (grib_context.c is modified outside of this pull request. So line numbers may not match there.)
grib_dump -O /home/suzuki/src/eccodes-orig/build/share/eccodes/samples/reduced_gg_pl_48_grib2.tmpl
==673984== Process terminating with default action of signal 11 (SIGSEGV)
==673984== Access not within mapped region at address 0x0
==673984== at 0x4A6B42E: grib_expression_free (grib_expression.c:92)
==673984== by 0x4A6B7AB: grib_arguments_free (grib_expression.c:162)
==673984== by 0x4A6B794: grib_arguments_free (grib_expression.c:161)
==673984== by 0x4A6B794: grib_arguments_free (grib_expression.c:161)
==673984== by 0x4A6B794: grib_arguments_free (grib_expression.c:161)
==673984== by 0x4A6B794: grib_arguments_free (grib_expression.c:161)
==673984== by 0x4A6B794: grib_arguments_free (grib_expression.c:161)
==673984== by 0x494C3AE: destroy (action_class_gen.c:212)
==673984== by 0x494AC7B: grib_action_delete (action.c:127)
==673984== by 0x4A20384: grib_context_reset (grib_context.c:798)
==673984== by 0x4A20602: grib_context_delete (grib_context.c:866)
==673984== by 0x4A1F175: eccodes_module_destructor (grib_context.c:375)

@shinji-s shinji-s changed the title Avoid null pointer derefrence in grib_expression_free(). Avoid null pointer dereference in grib_expression_free(). Aug 2, 2020
@shahramn shahramn merged commit 169c9b5 into ecmwf:develop Aug 2, 2020
@shinji-s shinji-s deleted the pr_fix_null_deref_expression branch August 10, 2020 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants