Skip to content

fix: incorrect inet_ntop() usage #185

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

Merged
merged 1 commit into from
Feb 15, 2025
Merged

fix: incorrect inet_ntop() usage #185

merged 1 commit into from
Feb 15, 2025

Conversation

sjinks
Copy link
Owner

@sjinks sjinks commented Feb 15, 2025

import cpp

from FunctionCall call, Expr afArg, Expr bufArg
where
  call.getTarget().hasName("inet_pton") and
  call.getArgument(0) = afArg and
  call.getArgument(2) = bufArg and (
    (afArg.getValue() = "2" and not bufArg.getUnderlyingType().hasName("in_addr *")) or
    (afArg.getValue() = "10" and not bufArg.getUnderlyingType().hasName("in6_addr *"))
  )
select call, "Incorrect buf argument type for inet_pton()."

@sjinks sjinks self-assigned this Feb 15, 2025
Copy link

@sjinks sjinks merged commit 96cbcca into master Feb 15, 2025
11 checks passed
@sjinks sjinks deleted the fix-inet_ntop-usage branch February 15, 2025 03:35
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.

1 participant