1
mirror of https://github.com/mpv-player/mpv synced 2024-10-18 10:25:02 +02:00

Use snprintf to ensure we do not write outside the buffer bounds

when recording stub names into export_names.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30638 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-02-18 20:20:23 +00:00
parent 4565c3ac28
commit 2903a8583f

View File

@ -5516,7 +5516,7 @@ void* LookupExternal(const char* library, int ordinal)
no_dll:
if(pos>150)return 0;
sprintf(export_names[pos], "%s:%d", library, ordinal);
snprintf(export_names[pos], sizeof(export_names[pos]), "%s:%d", library, ordinal);
return add_stub();
}
@ -5583,7 +5583,7 @@ void* LookupExternalByName(const char* library, const char* name)
no_dll_byname:
if(pos>150)return 0;// to many symbols
strcpy(export_names[pos], name);
snprintf(export_names[pos], sizeof(export_names[pos]), "%s", name);
return add_stub();
}