View | Details | Raw Unified | Return to bug 21684
Collapse All | Expand All

(-)strfmon_l.c (-1 / +11 lines)
Lines 233-239 Link Here
233
233
234
	  /* If we don't have enough room for the demanded width we
234
	  /* If we don't have enough room for the demanded width we
235
	     can stop now and return an error.  */
235
	     can stop now and return an error.  */
236
	  if (dest + width >= s + maxsize)
236
	  if (width < 0 || dest + width >= s + maxsize)
237
	    {
237
	    {
238
	      __set_errno (E2BIG);
238
	      __set_errno (E2BIG);
239
	      return -1;
239
	      return -1;
Lines 255-260 Link Here
255
	      left_prec *= 10;
255
	      left_prec *= 10;
256
	      left_prec += to_digit (*fmt);
256
	      left_prec += to_digit (*fmt);
257
	    }
257
	    }
258
	  if (left_prec < 0 || dest + left_prec >= s + maxsize)
259
	    {
260
	      __set_errno (E2BIG);
261
	      return -1;
262
	    }
258
	}
263
	}
259
264
260
      /* Recognize right precision.  */
265
      /* Recognize right precision.  */
Lines 272-277 Link Here
272
	      right_prec *= 10;
277
	      right_prec *= 10;
273
	      right_prec += to_digit (*fmt);
278
	      right_prec += to_digit (*fmt);
274
	    }
279
	    }
280
	  if (right_prec < 0 || dest + left_prec + right_prec >= s + maxsize )
281
	    {
282
	      __set_errno (E2BIG);
283
	      return -1;
284
	    }
275
	}
285
	}
276
286
277
      /* Handle modifier.  This is an extension.  */
287
      /* Handle modifier.  This is an extension.  */

Return to bug 21684