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

Webcam should prevent double close #56

Open
edaniels opened this issue Feb 16, 2023 · 0 comments
Open

Webcam should prevent double close #56

edaniels opened this issue Feb 16, 2023 · 0 comments

Comments

@edaniels
Copy link
Collaborator

In https://github.com/blackjack/webcam/blob/master/webcam.go#L276, a user may accidentally (due to a bug) call Close more than once. This is particularly dangerous since we're holding to a raw file descriptor number. This could play out as:

  1. First close (normal, expected)
  2. Some other code opens a file and gets that now unused file descriptor number
  3. Second close (bug, unexpected) and now the other code has its file descriptor unexpectedly modified
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

No branches or pull requests

1 participant