]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Fix wrong name len when converting path to modname
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 18 Dec 2011 17:12:19 +0000 (15:12 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 18 Dec 2011 17:12:57 +0000 (15:12 -0200)
libkmod/libkmod-module.c

index 6a64750bade83aeab963be6a9540c6c4b860a3d8..0330ffac9d2f4b32452280545342aca5371abd93 100644 (file)
@@ -366,7 +366,7 @@ KMOD_EXPORT int kmod_module_new_from_path(struct kmod_ctx *ctx,
 
        m->ctx = kmod_ref(ctx);
        m->name = (char *)m + sizeof(*m);
-       memcpy(m->name, name, namelen);
+       memcpy(m->name, name, namelen + 1);
        m->path = abspath;
        m->hashkey = m->name;
        m->refcount = 1;