summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--runtime/msg.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 71ac7448..92d582fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
---------------------------------------------------------------------------
-Version 5.8.5 [V5-stable] (al), 2011-??-??
+Version 5.8.5 [V5-stable] (rgerhards/al), 2011-??-??
+- bugfix: potential hang condition during tag emulation
+- bugfix: too-early string termination during tag emulation
- bugfix: The NUL-Byte for the syslogtag was not copied in MsgDup (msg.c)
---------------------------------------------------------------------------
Version 5.8.4 [V5-stable] (al), 2011-08-10
diff --git a/runtime/msg.c b/runtime/msg.c
index 9fdaded3..b18fb530 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1697,8 +1697,11 @@ static inline void tryEmulateTAG(msg_t *pM, sbool bLockMutex)
if(bLockMutex == LOCK_MUTEX)
MsgLock(pM);
- if(pM->iLenTAG > 0)
+ if(pM->iLenTAG > 0) {
+ if(bLockMutex == LOCK_MUTEX)
+ MsgUnlock(pM);
return; /* done, no need to emulate */
+ }
if(getProtocolVersion(pM) == 1) {
if(!strcmp(getPROCID(pM, MUTEX_ALREADY_LOCKED), "-")) {
@@ -1708,7 +1711,7 @@ static inline void tryEmulateTAG(msg_t *pM, sbool bLockMutex)
/* now we can try to emulate */
lenTAG = snprintf((char*)bufTAG, CONF_TAG_MAXSIZE, "%s[%s]",
getAPPNAME(pM, MUTEX_ALREADY_LOCKED), getPROCID(pM, MUTEX_ALREADY_LOCKED));
- bufTAG[32] = '\0'; /* just to make sure... */
+ bufTAG[sizeof(bufTAG)-1] = '\0'; /* just to make sure... */
MsgSetTAG(pM, bufTAG, lenTAG);
}
}