ensure null termination
This commit is contained in:
parent
288bd907f2
commit
624f93de8a
@ -61,6 +61,7 @@ static int get_messagefile_dll(const char *app, char *source, char *dllfile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
strncpy(dllfile, buf, MAX_MSG_LENGTH);
|
strncpy(dllfile, buf, MAX_MSG_LENGTH);
|
||||||
|
dllfile[MAX_MSG_LENGTH] = '\0';
|
||||||
|
|
||||||
RegCloseKey(hk);
|
RegCloseKey(hk);
|
||||||
|
|
||||||
@ -100,6 +101,7 @@ static int get_formatted_message(EVENTLOGRECORD *pevlr, char *dllfile,
|
|||||||
insert_strs);
|
insert_strs);
|
||||||
|
|
||||||
strncpy(msg, msgbuf, MAX_MSG_LENGTH);
|
strncpy(msg, msgbuf, MAX_MSG_LENGTH);
|
||||||
|
msg[MAX_MSG_LENGTH] = '\0';
|
||||||
|
|
||||||
FreeLibrary(hlib);
|
FreeLibrary(hlib);
|
||||||
LocalFree((HLOCAL)msgbuf);
|
LocalFree((HLOCAL)msgbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user