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 6a64750..0330ffa 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;