Skip to content

Commit

Permalink
Protect against deferencing null pointers in strNcpy macro
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkRivers committed Aug 21, 2024
1 parent 606903e commit 1ece831
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions asApp/src/save_restore.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,9 @@ extern float mySafeDoubleToFloat(double d);
int ii; \
char *dd=dest; \
const char *ss=src; \
for (ii=0; *ss && ii < N-1; ii++) \
*dd++ = *ss++; \
if (dd && ss) \
for (ii=0; *ss && ii < N-1; ii++) \
*dd++ = *ss++; \
*dd = '\0'; \
}

0 comments on commit 1ece831

Please sign in to comment.