-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Off-by-one error in binisstream #2
Comments
A patch that partially fixes this issue is already merged, but also #8 is needed |
Fixed by #8 |
opencubicplayer is still insisting this isn't fixed. Per their configure script: if test "x$with_adplug" != "xno"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking If libbinio used by AdPlug contains bugs https://github.com/adplug/libbinio/issues/2" >&5
$as_echo_n "checking If libbinio used by AdPlug contains bugs https://github.com/adplug/libbinio/issues/2... " >&6; }
CXXFLAGS="$CXXFLAGS $ADPLUG_CXXFLAGS"
LIBS="$LIBS $ADPLUG_LIBS"
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <binio.h>
#include <binstr.h>
#include <cstdlib>
#include <string.h>
#include <adplug/adplug.h>
#include <adplug/fprovide.h>
#include <string.h>
int
main ()
{
binisstream *f = new binisstream((void *)"foobar", 6);
long size;
char test[6] = {1,2,3,4,5,6};
f->seek(0, binio::End);
size = f->pos();
f->seek(0);
if (f->readString(test, size) != 6) return -1;
/* test should contain "foobar" if all is correct */
return memcmp(test, "foobar", 6);
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_run "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
else
as_fn_error $? "\"libbinio fails to use memoryobjects\"" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi This test bombs out with the latest code in this git repo. |
@sneakernets Please open a new issue if there's still a problem, it makes it difficult to keep track of where we're at if we have to remember to go back to closed issues, especially ones that were resolved so long ago with so many code changes since. |
binisstream
seems to report a value one too small infilesize()
. See adplug/adplug#17The text was updated successfully, but these errors were encountered: