This is an automated email from the ASF dual-hosted git repository.

baodi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-node.git


The following commit(s) were added to refs/heads/master by this push:
     new 22ebd78  fix malloc (#458)
22ebd78 is described below

commit 22ebd78d87353735a33e9bee784b37412adf3822
Author: Charlie Ede <[email protected]>
AuthorDate: Tue Mar 3 09:06:12 2026 +0000

    fix malloc (#458)
---
 src/Authentication.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Authentication.cc b/src/Authentication.cc
index c340821..3b04554 100644
--- a/src/Authentication.cc
+++ b/src/Authentication.cc
@@ -77,7 +77,7 @@ char *TokenSupplier(void *ctx) {
 
   future.wait();
 
-  char *token = (char *)malloc(dataPtr->token.size());
+  char *token = (char *)malloc(dataPtr->token.size() + 1);
   strcpy(token, dataPtr->token.c_str());
   return token;
 }

Reply via email to