equal
deleted
inserted
replaced
246 struct mpatch_frag *f = l->head; |
246 struct mpatch_frag *f = l->head; |
247 int last = 0; |
247 int last = 0; |
248 char *p = buf; |
248 char *p = buf; |
249 |
249 |
250 while (f != l->tail) { |
250 while (f != l->tail) { |
251 if (f->start < last || f->end > len || last < 0) { |
251 if (f->start < last || f->start > len || f->end > len || |
|
252 last < 0) { |
252 return MPATCH_ERR_INVALID_PATCH; |
253 return MPATCH_ERR_INVALID_PATCH; |
253 } |
254 } |
254 memcpy(p, orig + last, f->start - last); |
255 memcpy(p, orig + last, f->start - last); |
255 p += f->start - last; |
256 p += f->start - last; |
256 memcpy(p, f->data, f->len); |
257 memcpy(p, f->data, f->len); |