]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Testing for return of alias_normalize.
authorLuis Felipe Strano Moraes <lfelipe@profusion.mobi>
Tue, 20 Dec 2011 16:13:56 +0000 (08:13 -0800)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 21 Dec 2011 01:23:55 +0000 (23:23 -0200)
libkmod/libkmod-module.c

index 2d20792b5866b65a41e418db95b276807ffcf2d5..dee551a7781e9d4180776c9beacc8c8686a9ee35 100644 (file)
@@ -230,7 +230,10 @@ KMOD_EXPORT int kmod_module_new_from_name(struct kmod_ctx *ctx,
        if (ctx == NULL || name == NULL || mod == NULL)
                return -ENOENT;
 
-       alias_normalize(name, name_norm, &namelen);
+       if (alias_normalize(name, name_norm, &namelen) < 0) {
+               DBG(ctx, "invalid alias: %s\n", name);
+               return -EINVAL;
+       }
 
        m = kmod_pool_get_module(ctx, name_norm);
        if (m != NULL) {