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 data race in x509->response #331

Merged
merged 1 commit into from Aug 23, 2023
Merged

fix data race in x509->response #331

merged 1 commit into from Aug 23, 2023

Conversation

tarunKoyalwar
Copy link
Member

Proposed Changes

Possible Reason

  • this happens randomly (50%) even with race detector on . and issue seems to be with how append() function internally behaves i.e
    append(arr , elem) when using append new allocated slice is only returned if elem does not fit into existing array arr . if arr has enough space to fit elem then no new memory is allocated and arr itself is returned .
    our unexpected way of using append(arr,elem) was the cause but is now resolved since we are creating new slice and not using append for that

@tarunKoyalwar tarunKoyalwar self-assigned this Aug 22, 2023
@tarunKoyalwar tarunKoyalwar linked an issue Aug 22, 2023 that may be closed by this pull request
@tarunKoyalwar
Copy link
Member Author

  • tested x10 times no data race was detected
$ cat ~/test-templates/newips.txt | go run -race  . -t ~/test-templates/vhost-enum-flow.yaml

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v3.0.0-dev

		projectdiscovery.io

[INF] Current nuclei version: v3.0.0-dev (development)
[INF] Current nuclei-templates version: v9.6.1 (latest)
[INF] New templates added in latest release: 198
[INF] Templates loaded for current scan: 1
[INF] Targets loaded for current scan: 20
[INF] Running httpx on input host
[INF] Found 20 URL from httpx
[vhost-enum-flow] [http] [info] https://3.98.63.202/ [VHOST: uberflip.com, SC: 404, CL: 9607]
[vhost-enum-flow] [http] [info] https://52.60.165.183/ [VHOST: uberflip.com, SC: 404, CL: 9599]
[vhost-enum-flow] [http] [info] https://104.16.100.52/ [VHOST: hackerone.com, SC: 302, CL: 92]

Copy link
Member

@dogancanbakir dogancanbakir left a comment

Choose a reason for hiding this comment

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

LGTM.
Couldn't repro the issue.

@ehsandeep ehsandeep merged commit 3371c49 into dev Aug 23, 2023
11 checks passed
@ehsandeep ehsandeep deleted the fix-data-race-x509 branch August 23, 2023 11:13
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.

data race in tlsx due to "Convertx509toResponse()"
3 participants