Browse Source

nm-conf.c: check return result of fscanf

tags/1.138
Dimitri John Ledkov 5 years ago
parent
commit
416769d5c2
No known key found for this signature in database GPG Key ID: CAC2D8B9CD2CA5F9
2 changed files with 7 additions and 6 deletions
  1. +1
    -0
      debian/changelog
  2. +6
    -6
      nm-conf.c

+ 1
- 0
debian/changelog View File

@@ -7,6 +7,7 @@ netcfg (1.138) UNRELEASED; urgency=medium

[ Dimitri John Ledkov ]
* dhcp.c: check return result of two more fgets calls
* nm-conf.c: check return result of fscanf

-- Dimitri John Ledkov <xnox@ubuntu.com> Wed, 30 Mar 2016 12:13:56 +0100



+ 6
- 6
nm-conf.c View File

@@ -290,12 +290,12 @@ static void nm_get_mac_address(char *interface, char *mac_addr)
else {
int i;

fscanf(file, "%s\n", mac_addr);
/* Should be upper case. */
for (i = 0; mac_addr[i]; i++) {
mac_addr[i] = toupper(mac_addr[i]);
}
if (fscanf(file, "%s\n", mac_addr) != EOF) {
/* Should be upper case. */
for (i = 0; mac_addr[i]; i++) {
mac_addr[i] = toupper(mac_addr[i]);
}
}
}
}



Loading…
Cancel
Save