cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cordova-plugin-camera] sherburne opened a new pull request #592: (iOS) Fix for infinite loop reported in issue #591
Date Mon, 04 May 2020 18:28:47 GMT

sherburne opened a new pull request #592:
URL: https://github.com/apache/cordova-plugin-camera/pull/592


   <!--
   Please make sure the checklist boxes are all checked before submitting the PR. The checklist
is intended as a quick reference, for complete details please see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   iOS 13.x.
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   The `do..while` loop in `tempFilePath` has the potential to be infinite if the plugin is
also configured with `CameraUsesGeolocation` set to TRUE and the user is capturing an image
from the camera. I've reported this in [issue #591](https://github.com/apache/cordova-plugin-camera/issues/591).
   
   ### Description
   <!-- Describe your changes in detail -->
   
   The infinite condition can be easily avoided by moving the initialization of `filePath`
into the loop. The underlying problem is that `timeIntervalSince1970` only has second granularity,
however `tempFilePath` is called twice when capturing a picture when geolocation is enabled.
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   Tested on a base Cordova install running on iOS 13.x.
   
   ### Checklist
   
   - [x] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to one platform
(e.g. `(android)`)
   - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and
used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message