You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed-length strings and such strings stored in stack variables, even when carefully clamped and explicitly null-terminated, were a bad choice made in the early days of SOSflow implementation, before I knew better.
All SOS_DEFAULT_STRING_LEN instances should be removed from SOSflow. Strings should be unbounded in length, allocated, and memset to null, on the heap, period.
PROPOSED: Make simple wrapper functions...
char *SOS_string_copy(const char *);
void SOS_string_destroy(char *);
bool SOS_string_is_initalized(char **);
...OR...
// Create a std::string-style object for SOS, since SOS is written in C99.
SOS_string *name;
... so we have a single location where we can plug in various sanity checks, potential memory use optimizations like hashed-dupes with refcounts, and update the sosd_probe counts for memory usage related to strings.
The text was updated successfully, but these errors were encountered:
Fixed-length strings and such strings stored in stack variables, even when carefully clamped and explicitly null-terminated, were a bad choice made in the early days of SOSflow implementation, before I knew better.
All SOS_DEFAULT_STRING_LEN instances should be removed from SOSflow. Strings should be unbounded in length, allocated, and memset to null, on the heap, period.
PROPOSED: Make simple wrapper functions...
char *SOS_string_copy(const char *);
void SOS_string_destroy(char *);
bool SOS_string_is_initalized(char **);
...OR...
// Create a std::string-style object for SOS, since SOS is written in C99.
SOS_string *name;
... so we have a single location where we can plug in various sanity checks, potential memory use optimizations like hashed-dupes with refcounts, and update the sosd_probe counts for memory usage related to strings.
The text was updated successfully, but these errors were encountered: