I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and then change lstrcatA to StrCatBuffA.
-Alex
September 6, 2019 6:08 PM, "Alex Henrie" alexhenrie24@gmail.com wrote:
I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of
s/kernelbase/shlwapi, because kernelbase isn't available before Windows 7.
dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and then change lstrcatA to StrCatBuffA.
-Alex
Chip
Alex Henrie alexhenrie24@gmail.com writes:
I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and then change lstrcatA to StrCatBuffA.
Arguably such buffer overflows in tests don't matter either way, but using a function that would silently truncate the path is not an improvement in general.
On Sat, Sep 7, 2019 at 1:46 AM Alexandre Julliard julliard@winehq.org wrote:
Alex Henrie alexhenrie24@gmail.com writes:
I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and then change lstrcatA to StrCatBuffA.
Arguably such buffer overflows in tests don't matter either way, but using a function that would silently truncate the path is not an improvement in general.
That makes sense. However, I misspoke when I said to change lstrcatA to StrCatBuffA: The compiler warning is about sprintf, not strcat. So in this case I think it would make the most sense to replace the sprintf with lstrcpyA and lstrcatA similar to the rest of the tests in the function.
-Alex
On Sat, Sep 7, 2019 at 11:28 AM Alex Henrie alexhenrie24@gmail.com wrote:
On Sat, Sep 7, 2019 at 1:46 AM Alexandre Julliard julliard@winehq.org wrote:
Alex Henrie alexhenrie24@gmail.com writes:
I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and then change lstrcatA to StrCatBuffA.
Arguably such buffer overflows in tests don't matter either way, but using a function that would silently truncate the path is not an improvement in general.
That makes sense. However, I misspoke when I said to change lstrcatA to StrCatBuffA: The compiler warning is about sprintf, not strcat. So in this case I think it would make the most sense to replace the sprintf with lstrcpyA and lstrcatA similar to the rest of the tests in the function.
Actually, PathCombineA would be even better.
-Alex
On Sat, 7 Sep 2019, 11:16 pm Alex Henrie, alexhenrie24@gmail.com wrote:
On Sat, Sep 7, 2019 at 11:28 AM Alex Henrie alexhenrie24@gmail.com wrote:
On Sat, Sep 7, 2019 at 1:46 AM Alexandre Julliard julliard@winehq.org
wrote:
Alex Henrie alexhenrie24@gmail.com writes:
I think that instead of making the buffer bigger, it would be better to add kernelbase to the IMPORTS line of dlls/advpack/tests/Makefile.in, include shlwapi.h in files.c, and
then
change lstrcatA to StrCatBuffA.
Arguably such buffer overflows in tests don't matter either way, but using a function that would silently truncate the path is not an improvement in general.
That makes sense. However, I misspoke when I said to change lstrcatA to StrCatBuffA: The compiler warning is about sprintf, not strcat. So in this case I think it would make the most sense to replace the sprintf with lstrcpyA and lstrcatA similar to the rest of the tests in the function.
Actually, PathCombineA would be even better.
-Alex
Sorry for being late, I was a bit busy.
I'll use PathCombineA then.
Isira
On Wed, Sep 11, 2019 at 8:28 PM Isira Seneviratne isirasen96@gmail.com wrote:
Sorry for being late, I was a bit busy.
I'll use PathCombineA then.
I already sent a PathCombineA patch for this file: https://source.winehq.org/patches/data/169559
-Alex
On Thu, 12 Sep 2019, 8:26 am Alex Henrie, alexhenrie24@gmail.com wrote:
On Wed, Sep 11, 2019 at 8:28 PM Isira Seneviratne isirasen96@gmail.com wrote:
Sorry for being late, I was a bit busy.
I'll use PathCombineA then.
I already sent a PathCombineA patch for this file: https://source.winehq.org/patches/data/169559
-Alex
Okay then, thanks!