Comments (3)
Actually, the buffer overflow happens in many SDK functions, when using library on Ubuntu 18.04 64 bit platform.
System:
OS: Ubuntu 18.04.3 LTS
OS type: 64-bit
Memory: 8GB
Biostar SDK library version: 2.6.3.16 (have also tried 2.6.3.13 an 2.6.3.19 beta release) - results are always the same
Few examples:
Test case No.1
=============================================
void* _pBiostarContext = NULL;
int main(){
printf("Application started!\n");
_pBiostarContext = BS2_AllocateContext();
if(_pBiostarContext != NULL){
int nResult = BS2_Initialize(_pBiostarContext);
if(nResult != BS_SDK_SUCCESS){
printf("Failed to initialize context!\n");
BS2_ReleaseContext(_pBiostarContext);
return EXIT_FAILURE;
}
printf("Using Biostar library version %s\n", BS2_Version());
}
else{
printf("Failed to allocate context!\n");
return EXIT_FAILURE;
}
BS2_ReleaseContext(_pBiostarContext); // <-- Can not get past this
printf("Application finished!\n");
return EXIT_SUCCESS;
}
Expected output:
Application started!
Using Biostar library version 2.6.3.16
Application finished!
Actual output:
Application started!
Using Biostar library version 2.6.3.16
*** buffer overflow detected ***
Test case No.2 (failed reader connection)
=============================================
void* _pBiostarContext = NULL;
const char* _cHost = "<Invalid reader IP here>";
int _nPort = 51211;.
int _nbiostarDeviceId = 0;
int main(){
printf("Application started!\n");
_pBiostarContext = BS2_AllocateContext();
if(_pBiostarContext != NULL){
int nResult = BS2_Initialize(_pBiostarContext);
if(nResult != BS_SDK_SUCCESS){
printf("Failed to initialize context!\n");
BS2_ReleaseContext(_pBiostarContext);
return EXIT_FAILURE;
}
printf("Using Biostar library version %s\n", BS2_Version());
}
else{
printf("Failed to allocate context!\n");
return EXIT_FAILURE;
}
printf("Connecting to reader\n");
while(BS_SDK_SUCCESS != BS2_ConnectDeviceViaIP(_pBiostarContext,
_cHost, _nPort, &_nBiostarDeviceId)) // <-- Buffer overflow if the connection does not succeed
{
printf("Retrying reader connection\n"); // <-- Never gets here
}
printf("Connected to reader\n");
/*Rest of the application code
..........
*/
BS2_ReleaseContext(_pBiostarContext);
printf("Application finished!\n");
return EXIT_SUCCESS;
}
Expected output:
Application started!
Using Biostar library version 2.6.3.16
Connecting to reader!
Retrying reader connection
Retrying reader connection
And so on....
Actual output:
Using Biostar library version 2.6.3.16
Connecting to reader
*** buffer overflow detected ***
from biostar2_device_sdk.
Same issue here
from biostar2_device_sdk.
This problem solved in SDK 2.6.3.23
from biostar2_device_sdk.
Related Issues (20)
- Modify function BS2_ClearLog
- Total Log In Device
- Linux sdk HOT 1
- SDK for Biostar 1 HOT 1
- Support error sofware HOT 1
- Added support for ARM devices
- BS2_EnrollUserFaceEx with BS2Face Templates HOT 1
- BS2_SetIPConfigを理解したいがエラーで困っています HOT 1
- Linux support HOT 2
- linux build error `pthread_yield' HOT 1
- using BS2_ConnectDeviceViaIP with Intptr type of IPAddress HOT 1
- How to write alphanumeric id on card HOT 2
- BS_SDK_ERROR_TIMEOUT = -601
- BS2_EnrollUserFaceEx crashes with accessViolation
- Bioentry P2, Rasberry Pi Support
- Add fingerprint / face to an already created user HOT 1
- Lastest release not working for windows 11 HOT 5
- BS2_UpgradeFirmware function not working on linux HOT 1
- 'Util' does not exist - C#
- 'setTriggerActionConfig' does not exist in C#
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biostar2_device_sdk.