Skip to content
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

Fix memory corruption in tree.c #763

Merged
merged 3 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
compiler: [gcc, clang]
buildtype: [debug, release]
container:
image: ghcr.io/igaw/linux-nvme/debian:latest
image: ghcr.io/igaw/linux-nvme/debian.python:latest
steps:
- uses: actions/checkout@v4
- name: build
Expand Down
10 changes: 5 additions & 5 deletions libnvme/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ if build_python_bindings
test_env.append('PYTHONMALLOC', 'malloc')

# Test section
test('[Python] import libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env, depends: pynvme_clib)
test('python-import-libnvme', python3, args: ['-c', 'from libnvme import nvme'], env: test_env, depends: pynvme_clib)

py_tests = [
[ 'create ctrl object', [ files('tests/create-ctrl-obj.py'), ] ],
[ 'SIGSEGV during gc', [ files('tests/gc.py'), ] ],
[ 'Read NBFT file', [ files('tests/test-nbft.py'), '--filename', join_paths(meson.current_source_dir(), 'tests', 'NBFT') ] ],
[ 'create-ctrl-object', [ files('tests/create-ctrl-obj.py'), ] ],
[ 'sigsegv-during-gc', [ files('tests/gc.py'), ] ],
[ 'read-nbft-file', [ files('tests/test-nbft.py'), '--filename', join_paths(meson.current_source_dir(), 'tests', 'NBFT') ] ],
]
foreach test: py_tests
description = test[0]
args = test[1]
test('[Python] ' + description, python3, args: args, env: test_env, depends: pynvme_clib)
test('python-' + description, python3, args: args, env: test_env, depends: pynvme_clib)
endforeach
endif
2 changes: 1 addition & 1 deletion src/nvme/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,7 +2473,7 @@ static int nvme_ns_init(const char *path, struct nvme_ns *ns)

ret = nvme_ns_identify(ns, id);
if (ret)
free(ns);
return ret;

nvme_id_ns_flbas_to_lbaf_inuse(id->flbas, &flbas);
ns->lba_count = le64_to_cpu(id->nsze);
Expand Down
2 changes: 1 addition & 1 deletion test/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ if conf.get('HAVE_NETDB')
['test-util.c'],
include_directories: [incdir, internal_incdir]
)
test('Test util.c', test_util)
test('util', test_util)
endif

subdir('ioctl')
Expand Down
Loading