All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch to context_new to set errno to EINVAL on bad values
@ 2010-03-24 13:17 Daniel J Walsh
  2010-03-24 18:28 ` Joshua Brindle
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel J Walsh @ 2010-03-24 13:17 UTC (permalink / raw)
  To: SELinux

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: libselinux_context_new.patch --]
[-- Type: text/plain, Size: 577 bytes --]

diff --git a/libselinux/src/context.c b/libselinux/src/context.c
index 8164104..b673733 100644
--- a/libselinux/src/context.c
+++ b/libselinux/src/context.c
@@ -22,6 +22,7 @@ typedef struct {
 context_t context_new(const char *str)
 {
 	int i, count;
+	errno = 0;
 	context_private_t *n =
 	    (context_private_t *) malloc(sizeof(context_private_t));
 	context_t result = (context_t) malloc(sizeof(context_s_t));
@@ -76,6 +77,7 @@ context_t context_new(const char *str)
 	}
 	return result;
       err:
+	if (errno == 0) errno = EINVAL;
 	context_free(result);
 	return 0;
 }

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Patch to context_new to set errno to EINVAL on bad values
  2010-03-24 13:17 Patch to context_new to set errno to EINVAL on bad values Daniel J Walsh
@ 2010-03-24 18:28 ` Joshua Brindle
  0 siblings, 0 replies; 2+ messages in thread
From: Joshua Brindle @ 2010-03-24 18:28 UTC (permalink / raw)
  To: Daniel J Walsh; +Cc: SELinux

Merged in libselinux-2.0.94

Daniel J Walsh wrote:
>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-24 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 13:17 Patch to context_new to set errno to EINVAL on bad values Daniel J Walsh
2010-03-24 18:28 ` Joshua Brindle

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.