Bug fix: While loading an ISO image several reads to malloc
memory occured with byte index -1. (Found by Valgrind after years of operation without visible problems.)
This commit is contained in:
parent
9210a57500
commit
76b6737570
@ -1536,16 +1536,17 @@ char *iso_util_strcopy(const char *buf, size_t len)
|
|||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *iso_util_strcopy_untail(const char *buf, size_t len)
|
char *iso_util_strcopy_untail(const char *buf, size_t len_in)
|
||||||
{
|
{
|
||||||
char *str;
|
char *str;
|
||||||
|
int len;
|
||||||
|
|
||||||
str = iso_util_strcopy(buf, len);
|
str = iso_util_strcopy(buf, len_in);
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
/* remove trailing spaces */
|
/* remove trailing spaces */
|
||||||
for (len = len-1; len >= 0; --len) {
|
for (len = len_in - 1; len >= 0; --len) {
|
||||||
if (str[len] != ' ')
|
if (str[len] != ' ')
|
||||||
break;
|
break;
|
||||||
str[len] = 0;
|
str[len] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user