Removed multiple heap-allocated copies in parse_pm_content

- The previous version of this function was doing three strdup copies
  to parse the pm content. The updated version only copies the value
  once (in order not to modify the Operator's m_param member variable),
  and then performs the updates inline.
- Binary parsing was broken because digits were not compared as
  characters.
  - Fail parsing when an invalid hex character is found.
- Error message in parse_pm_content would reference freed memory if
  accessed by caller. Removed anyway because it was unused.
This commit is contained in:
Eduardo Arias
2024-08-09 13:01:37 -07:00
parent 97c8766ef1
commit 3e9d8107a8
6 changed files with 75 additions and 189 deletions

View File

@@ -17,7 +17,6 @@
#define SRC_OPERATORS_PM_H_
#include <string>
#include <list>
#include <memory>
#include <utility>
#include <mutex>