Revision 511d2b14 block-vmdk.c
b/block-vmdk.c | ||
---|---|---|
134 | 134 |
cid_str_size = sizeof("CID"); |
135 | 135 |
} |
136 | 136 |
|
137 |
if ((p_name = strstr(desc,cid_str)) != 0) {
|
|
137 |
if ((p_name = strstr(desc,cid_str)) != NULL) {
|
|
138 | 138 |
p_name += cid_str_size; |
139 | 139 |
sscanf(p_name,"%x",&cid); |
140 | 140 |
} |
... | ... | |
154 | 154 |
|
155 | 155 |
tmp_str = strstr(desc,"parentCID"); |
156 | 156 |
pstrcpy(tmp_desc, sizeof(tmp_desc), tmp_str); |
157 |
if ((p_name = strstr(desc,"CID")) != 0) {
|
|
157 |
if ((p_name = strstr(desc,"CID")) != NULL) {
|
|
158 | 158 |
p_name += sizeof("CID"); |
159 | 159 |
snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid); |
160 | 160 |
pstrcat(desc, sizeof(desc), tmp_desc); |
... | ... | |
239 | 239 |
if (read(p_fd, p_desc, DESC_SIZE) != DESC_SIZE) |
240 | 240 |
goto fail; |
241 | 241 |
|
242 |
if ((p_name = strstr(p_desc,"CID")) != 0) {
|
|
242 |
if ((p_name = strstr(p_desc,"CID")) != NULL) {
|
|
243 | 243 |
p_name += sizeof("CID"); |
244 | 244 |
sscanf(p_name,"%x",&p_cid); |
245 | 245 |
} |
... | ... | |
330 | 330 |
if (bdrv_pread(s->hd, 0x200, desc, DESC_SIZE) != DESC_SIZE) |
331 | 331 |
return -1; |
332 | 332 |
|
333 |
if ((p_name = strstr(desc,"parentFileNameHint")) != 0) {
|
|
333 |
if ((p_name = strstr(desc,"parentFileNameHint")) != NULL) {
|
|
334 | 334 |
char *end_name; |
335 | 335 |
struct stat file_buf; |
336 | 336 |
|
337 | 337 |
p_name += sizeof("parentFileNameHint") + 1; |
338 |
if ((end_name = strchr(p_name,'\"')) == 0)
|
|
338 |
if ((end_name = strchr(p_name,'\"')) == NULL)
|
|
339 | 339 |
return -1; |
340 | 340 |
if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1) |
341 | 341 |
return -1; |
Also available in: Unified diff