VOL-5193:Sanitize the retrieved MIB Template for NULL termination of strings
Change-Id: Ib2b899699090bdde7c541c8e8620a35665651e48
diff --git a/internal/pkg/mib/mib_sync.go b/internal/pkg/mib/mib_sync.go
index b5fd996..f227cdf 100755
--- a/internal/pkg/mib/mib_sync.go
+++ b/internal/pkg/mib/mib_sync.go
@@ -1437,8 +1437,9 @@
oo.MutexPersOnuConfig.RLock()
mibTmpString2 := strings.Replace(mibTmpString, "%SERIAL_NUMBER%", oo.SOnuPersistentData.PersSerialNumber, -1)
mibTmpString = strings.Replace(mibTmpString2, "%MAC_ADDRESS%", oo.SOnuPersistentData.PersMacAddress, -1)
+ mibTmpString2 = strings.ReplaceAll(mibTmpString, "\x00", "")
oo.MutexPersOnuConfig.RUnlock()
- mibTmpBytes := []byte(mibTmpString)
+ mibTmpBytes := []byte(mibTmpString2)
logger.Debugf(ctx, "MibSync FSM - Mib template tokens swapped out: %s", mibTmpBytes)
var firstLevelMap map[string]interface{}