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

Fix SEGFAULT errors introduced by dns_resolver in socketio (gh# 1275) #415

Merged
merged 6 commits into from
Nov 22, 2019

Conversation

ewertons
Copy link
Contributor

Relates to: Azure/azure-iot-sdk-c#1275

There were two instances of possible failures not properly handled on socketio related to dns_resolver:

  • The result of dns_resolver_create() was not being checked for NULL (which could be caused by memory allocation failure);
  • The result of dns_resolver_get_addrInfo() was not being checked for NULL, which could happen even if dns_resolver_is_lookup_complete returned true.

These failures affected socketio_berkeley.c and socketio_win32.c.
The currently remaining socketio implementations were not affected, since they do not use dns_resolver (socketio_mbed.c, socketio_mbed_os5.c).

Thanks @mlilien for the initial PR to fix this issue.

Relates to: Azure/azure-iot-sdk-c#1275

There were two instances of possible failures not properly handled on socketio related to dns_resolver:
- The result of dns_resolver_create() was not being checked for NULL (which could be caused by memory allocation failure);
- The result of dns_resolver_get_addrInfo() was not being checked for NULL, which could happen even if dns_resolver_is_lookup_complete returned true.

These failures affected socketio_berkeley.c and socketio_win32.c.
The currently remaining socketio implementations were not affected, since they do not use dns_resolver (socketio_mbed.c, socketio_mbed_os5.c).

Thanks @mlilien for the initial PR to fix this issue.
@ewertons ewertons requested review from massand, jspaith, jebrando, CIPop, danewalton-msft, hihigupt and jasmineymlo and removed request for massand November 21, 2019 21:58
@ewertons ewertons requested a review from jspaith November 21, 2019 22:37
Copy link
Contributor

@jebrando jebrando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@jspaith jspaith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@ewertons ewertons force-pushed the FixDnsREsolverSegfault branch from f78710e to 40a4e53 Compare November 22, 2019 02:58
@ewertons ewertons merged commit be7aa82 into master Nov 22, 2019
@ewertons ewertons deleted the FixDnsREsolverSegfault branch November 22, 2019 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants