On Thu, 3 Oct 1996, Jörgen Zigge Sigvardsson wrote: > > > Just wondering about the code snippet presented below. > > > > sprintf(buf, "mail -s \"%s\" %s <MAILFILE.TXT &", subject, emailaddr); > > > > if (strchr(emailaddr, ';') != NULL) { > ^^^^^^^^^^^^^ > What happens if this would be a '&' instead? Bye bye files > > Make some kind of generic function that will check the incoming string. > Allow NO Unix shell-characters ; : & > < and you will be fine. > then this should do it: if (strchr(";:&<>", emailaddr) != NULL) { +-----------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://cspo.queensu.ca/~fletcher/Circle/list_faq.html | +-----------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/18/00 PST