cdrom.c: fix pointer arithmetics (ldv@)

p happened to be off-by-const (5) thus pointing
way after the end of the string; looks like an
assembly-level overoptimization with two concurrent
thoughts or more...

Thanks ldv@ for figuring this out.

See also https://bugzilla.altlinux.org/28289
This commit is contained in:
Michael Shigorin 2015-03-06 20:53:50 +03:00
parent e206e2431f
commit c011d5e337

View File

@ -26,7 +26,6 @@
#include <string.h>
#include <stdio.h>
#include <sys/mount.h>
#include <dirent.h>
#include <ctype.h>
#include "stage1.h"
#include "frontend.h"
@ -47,9 +46,9 @@ static int mount_iso9660(char * dev_name)
static int mount_that_cd_device(char * dev_name)
{
char device_fullname[64] = "/dev/";
char * p = strcpy(device_fullname + 5, dev_name);
strcat(device_fullname, dev_name);
p += strlen(device_fullname);
char * p = device_fullname + strlen(device_fullname);
if (islower(p[-1])) {
int ret;