Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-22 Thread Siddhesh Poyarekar
On 2022-11-22 15:43, Jeff Law wrote: On 11/21/22 07:27, Siddhesh Poyarekar wrote: On 2022-11-20 10:42, Jeff Law wrote: On 11/4/22 06:48, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object.  Avoid doing the same for strndup sin

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-22 Thread Jeff Law via Gcc-patches
On 11/21/22 07:27, Siddhesh Poyarekar wrote: On 2022-11-20 10:42, Jeff Law wrote: On 11/4/22 06:48, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object.  Avoid doing the same for strndup since there's a chance that the input ma

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-21 Thread Siddhesh Poyarekar
On 2022-11-20 10:42, Jeff Law wrote: On 11/4/22 06:48, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object.  Avoid doing the same for strndup since there's a chance that the input may be too large, resulting in an unnecessary overh

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-20 Thread Jeff Law via Gcc-patches
On 11/4/22 06:48, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object. Avoid doing the same for strndup since there's a chance that the input may be too large, resulting in an unnecessary overhead or worse, the input may not be NU

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-17 Thread Siddhesh Poyarekar
Ping! On 2022-11-04 08:48, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object. Avoid doing the same for strndup since there's a chance that the input may be too large, resulting in an unnecessary overhead or worse, the input may n

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-04 Thread Siddhesh Poyarekar
On 2022-11-04 09:43, Prathamesh Kulkarni wrote: On Fri, 4 Nov 2022 at 18:18, Siddhesh Poyarekar wrote: Use string length of input to strdup to determine the usable size of the resulting object. Avoid doing the same for strndup since there's a chance that the input may be too large, resulting

Re: [PATCH v2] tree-object-size: Support strndup and strdup

2022-11-04 Thread Prathamesh Kulkarni via Gcc-patches
On Fri, 4 Nov 2022 at 18:18, Siddhesh Poyarekar wrote: > > Use string length of input to strdup to determine the usable size of the > resulting object. Avoid doing the same for strndup since there's a > chance that the input may be too large, resulting in an unnecessary > overhead or worse, the i

[PATCH v2] tree-object-size: Support strndup and strdup

2022-11-04 Thread Siddhesh Poyarekar
Use string length of input to strdup to determine the usable size of the resulting object. Avoid doing the same for strndup since there's a chance that the input may be too large, resulting in an unnecessary overhead or worse, the input may not be NULL terminated, resulting in a crash where there