[PATCH] Check error from asprintf() correctly for dhcpclass handling.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If asprintf() errors, it returns -1.  Check for that correctly and
return 20 on error.

[rawhide]
---
 loader/net.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/loader/net.c b/loader/net.c
index aead300..e7f6c70 100644
--- a/loader/net.c
+++ b/loader/net.c
@@ -1170,7 +1170,7 @@ int writeEnabledNetInfo(iface_t *iface) {
             iface->vendorclass = "anaconda";
         } else {
             if (asprintf(&iface->vendorclass, "anaconda-%s %s %s",
-                         kv.sysname, kv.release, kv.machine)) {
+                         kv.sysname, kv.release, kv.machine) == -1 ) {
                 return 20;
             }
         }
-- 
1.6.0.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux