mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Another utility function, to free a string containing sensitive data.
[originally from svn r9319]
This commit is contained in:
parent
535d77abf0
commit
ff5a9c77fd
8
misc.c
8
misc.c
@ -200,6 +200,14 @@ char *dupcat(const char *s1, ...)
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void burnstr(char *string) /* sfree(str), only clear it first */
|
||||||
|
{
|
||||||
|
if (string) {
|
||||||
|
memset(string, 0, strlen(string));
|
||||||
|
sfree(string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do an sprintf(), but into a custom-allocated buffer.
|
* Do an sprintf(), but into a custom-allocated buffer.
|
||||||
*
|
*
|
||||||
|
1
misc.h
1
misc.h
@ -28,6 +28,7 @@ char *dupstr(const char *s);
|
|||||||
char *dupcat(const char *s1, ...);
|
char *dupcat(const char *s1, ...);
|
||||||
char *dupprintf(const char *fmt, ...);
|
char *dupprintf(const char *fmt, ...);
|
||||||
char *dupvprintf(const char *fmt, va_list ap);
|
char *dupvprintf(const char *fmt, va_list ap);
|
||||||
|
void burnstr(char *string);
|
||||||
|
|
||||||
char *fgetline(FILE *fp);
|
char *fgetline(FILE *fp);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user