Hi,
I would like your expertise in order to protect my code for strings without the \0 terminator (in case of memory corruption). Currently the code is failing because when it invokes strlen for a string with trash in it it never finds the \0 terminator then returns the size of the datatype (per example: int 8 string var will return 256. Can anyone give some clue on how can I ensure that I will not have this problem (per example: if the string is corrupted return error instead go ahead with the strlen). Also I would like to differentiate the trash string with \0 from a sane string with \0 in the END (but I think this is not feasible right?)
Thanks
BTCMan
I would like your expertise in order to protect my code for strings without the \0 terminator (in case of memory corruption). Currently the code is failing because when it invokes strlen for a string with trash in it it never finds the \0 terminator then returns the size of the datatype (per example: int 8 string var will return 256. Can anyone give some clue on how can I ensure that I will not have this problem (per example: if the string is corrupted return error instead go ahead with the strlen). Also I would like to differentiate the trash string with \0 from a sane string with \0 in the END (but I think this is not feasible right?)
Thanks
BTCMan