Hi Canh,

Ack

Thanks
Lennart

-----Original Message-----
From: Canh Van Truong <canh.v.tru...@dektech.com.au> 
Sent: den 14 mars 2019 12:49
To: Lennart Lund <lennart.l...@ericsson.com>; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Canh Van Truong 
<canh.v.tru...@dektech.com.au>
Subject: [PATCH 1/1] log: logd crash due to well known stream has numOpeners = 
0 [#3018]

When the stream is created, the numOpeners is not initialized and may be 
started with unexpected value (e.g max value of unsigned int32).
It is not correct. That may cause when client close the well known stream and 
numOpeners may be 0. The crash happens.

The "numOpeners" should be initialized with 0.
---
 src/log/logd/lgs_stream.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/log/logd/lgs_stream.cc b/src/log/logd/lgs_stream.cc index 
28344c8cd..8ad0757b9 100644
--- a/src/log/logd/lgs_stream.cc
+++ b/src/log/logd/lgs_stream.cc
@@ -719,6 +719,7 @@ log_stream_t *log_stream_new(const std::string &name, int 
stream_id) {
   stream->severityFilter = 0x7f; /* by default all levels are allowed */
   stream->isRtStream = SA_FALSE;
   stream->dest_names.clear();
+  stream->numOpeners = 0;  // Set the number of openers is 0 at 
+ creating stream
 
   /* Initiate local or shared stream file descriptor dependant on shared or
    * split file system
--
2.15.1



_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to