View | Details | Raw Unified | Return to bug 22198 | Differences between
and this patch

Collapse All | Expand All

(-)inet_ntop.c (-2 / +2 lines)
Lines 86-92 Link Here
86
	char tmp[sizeof "255.255.255.255"];
86
	char tmp[sizeof "255.255.255.255"];
87
87
88
	if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
88
	if (SPRINTF((tmp, fmt, src[0], src[1], src[2], src[3])) > size) {
89
		errno = ENOSPC;
89
		errno = EINVAL;
90
		return (NULL);
90
		return (NULL);
91
	}
91
	}
92
	strcpy(dst, tmp);
92
	strcpy(dst, tmp);
Lines 183-189 Link Here
183
	 * Check for overflow, copy, and we're done.
183
	 * Check for overflow, copy, and we're done.
184
	 */
184
	 */
185
	if ((size_t)(tp - tmp) > size) {
185
	if ((size_t)(tp - tmp) > size) {
186
		errno = ENOSPC;
186
		errno = EINVAL;
187
		return (NULL);
187
		return (NULL);
188
	}
188
	}
189
	strcpy(dst, tmp);
189
	strcpy(dst, tmp);

Return to bug 22198