kopia lustrzana https://gitlab.com/sane-project/backends
pixmap: omitting curly braces considered harmful
The break being outside of the else block effectively made an if clause out of the while loop. This caused long hostnames to not be shortened sufficiently which subsequentely made strcpy() write beyond buffer boundaries.merge-requests/1/head
rodzic
3b96baef65
commit
d35d6326cb
|
@ -364,11 +364,13 @@ determine_scanner_serial (const char *hostname, const char * mac_address, char *
|
|||
/* if this is a FQDN, not an ip-address, remove domain part of the name */
|
||||
if ((dot = strchr (copy, '.')) != NULL)
|
||||
{
|
||||
*dot = '\0';
|
||||
*dot = '\0';
|
||||
}
|
||||
else
|
||||
strcpy(copy, mac_address);
|
||||
break;
|
||||
{
|
||||
strcpy(copy, mac_address);
|
||||
break;
|
||||
}
|
||||
}
|
||||
strcpy( serial, copy );
|
||||
return serial;
|
||||
|
|
Ładowanie…
Reference in New Issue