Comments (5)
Please specify which version you are using. Here's current develop code (i.e. 1.5.1 relase):
if (isNullLengthIndicator(_lengths[pos]))
return false;
else
{
//for fixed-length data, buffer must be large enough
//otherwise, driver may write past the end
poco_assert_dbg (_lengths[pos] <= sizeof(T));
val = value;
}
from poco.
Hi Aleks,
thanks for your response!
I'm using current stable release, e.g. 1.4.6, and, therefore, my report refers to that version, sorry for not mentioning it in my original post.
Development code (1.5.1) that you pointed me out to has reworked that function and covers the case of SQL_NULL_DATA
by performing a isNullLengthIndicator
check before the comparison. At the same time as there still takes place a signed / unsigned comparison, other possible negative values of _lengths[pos]
, which is a signed value, either int64
or long
(e.g. SQL_DATA_AT_EXEC
), will result in false assertion. I'm not sure if SQL_DATA_AT_EXEC
may be achieved at that exact point of code in semantically correct way, but if so (or if any other negative "reserved" length value is returned), the issue will still take place.
Dmitry.
from poco.
The only two values (besides the length itself) that can be returned ( see http://msdn.microsoft.com/en-us/library/windows/desktop/ms715441(v=vs.85).aspx ) are SQL_NULL_DATA and SQL_NO_TOTAL. Since SQL_NO_TOTAL only applies to character and binary data, it is handled in specializations of extractManualImpl:
if (SQL_NO_TOTAL == len)//unknown length, throw
throw UnknownDataLengthException("Could not determine returned data length.");
if (isNullLengthIndicator(len))
{ ...
EDIT: 2/16/03 1705UTC edited code snippet to reflect both values being checked
from poco.
Yes, I agree.
I was mislead by generic topic on length / indicator values (http://msdn.microsoft.com/en-us/library/windows/desktop/ms713532(v=vs.85).aspx) which applies not only to SQLGetData
but to other SQL*
functions as well.
Therefore the issue is relevant only in current (1.4.6) version and looks to be addressed in 1.5.x.
Thanks,
Dmitry.
from poco.
@obiltschnig : any plans to address this in 1.4.x ? if not, or it was done, let's close it
from poco.
Related Issues (20)
- Socket::available Causes Connection Reset by Peer on Windows UDP Sockets HOT 3
- SetSourceIP Error
- Postgres CMakeList.txt HOT 1
- Using passive mode, it seems that it has not been converted to data connection
- The load balancing issue in Poco::ActiveThreadPool HOT 5
- ServerApplication waitForTerminationRequest terminate HOT 1
- Poco::ClassLoader will crashed when DLL and EXE not use MD/MDd RunTime-Library HOT 6
- Configurable or uniform chunk size in transfer encoded responses.
- Poco::Logger can not output __FILE__ and __LINE__ HOT 12
- Overriding SocketReactor::run() is not reasonably possible HOT 1
- NestedDiagnosticContext crashed in multi-thread environment
- Some of icompare overloads are error prone HOT 1
- ServerApplication has no pidfile option on windows
- Causing websocket to disconnect and the client not receiving any messages
- Poco::Path::forDirectory("C:") throws if the path is disk-letter only
- Poco::FileStream std::fstream HOT 3
- Process::launch to execute tail -n command, when n > 100 , wait() func while never return HOT 1
- Building on Windows and Integrating to UE5 gives PocoFoundation.lib error HOT 4
- Serving a Static Web Page and NTDDLL Error
- I met this Error [ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine]
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 poco.