Skip to content

Commit fe0dd97

Browse files
committed
Fix stack corruption causing a crash on Windows with connection pooling
1 parent 3ca2c76 commit fe0dd97

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/njs/src/njsOracle.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*
2424
*****************************************************************************/
2525

26+
#include "node.h"
27+
2628
#include "njsOracle.h"
2729
#include "njsConnection.h"
2830
#include "njsPool.h"
@@ -53,6 +55,7 @@ Oracledb::Oracledb()
5355
poolMin_ = POOL_MIN;
5456
poolIncrement_ = POOL_INCR;
5557
poolTimeout_ = POOL_TIMEOUT;
58+
connClass_ = "";
5659
}
5760

5861
/*****************************************************************************/

src/njs/src/njsOracle.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class Oracledb: public ObjectWrap
7979
// Create Pool Methods
8080
static Handle<Value> CreatePool (const Arguments& args);
8181
static void Async_CreatePool (uv_work_t *req );
82-
static void Async_AfterCreatePool (uv_work_t *req );
82+
static void Async_AfterCreatePool (uv_work_t *req);
8383

8484
// Define Getter Accessors to Properties
8585
static Handle<Value> GetPoolMin(Local<String> property,

src/njs/src/njsPool.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
*
2424
*****************************************************************************/
2525

26+
#include "node.h"
27+
28+
#include <string>
29+
2630
#include "njsOracle.h"
2731
#include "njsPool.h"
2832
#include "njsConnection.h"
@@ -504,11 +508,12 @@ void Pool::Async_GetConnection(uv_work_t *req)
504508
505509
PARAMETERS:
506510
UV queue work block
511+
status - expected to be non-zero.
507512
508513
NOTES:
509514
Connection handle is formed and handed over to JS.
510515
*/
511-
Handle<Value> Pool::Async_AfterGetConnection(uv_work_t *req)
516+
void Pool::Async_AfterGetConnection(uv_work_t *req)
512517
{
513518
HandleScope scope;
514519
connectionBaton *connBaton = (connectionBaton*)req->data;
@@ -536,7 +541,6 @@ Handle<Value> Pool::Async_AfterGetConnection(uv_work_t *req)
536541
node::FatalException(tc);
537542
}
538543
delete connBaton;
539-
return Undefined();
540544
}
541545

542546
/*****************************************************************************/

src/njs/src/njsPool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Pool: public ObjectWrap {
5353
// Get Connection Methods
5454
static Handle<Value> GetConnection(const Arguments& args);
5555
static void Async_GetConnection(uv_work_t* req);
56-
static Handle<Value> Async_AfterGetConnection(uv_work_t* req);
56+
static void Async_AfterGetConnection(uv_work_t* req);
5757

5858
// Terminate Methods
5959
static Handle<Value> Terminate(const Arguments& args);

0 commit comments

Comments
 (0)