From: mar Date: Mon, 26 Jun 1989 14:09:11 +0000 (+0000) Subject: don't allow a trailing backslash on any argument (it will quote the closing X-Git-Tag: PATCH5~51 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/02d466cf399feb8d0c695cbca840e3e28e4a8ded?hp=c13d12155f47ca41db077533b5e9e2a66fc5da4c don't allow a trailing backslash on any argument (it will quote the closing doublequote and confuse the Ingres interpreter) --- diff --git a/server/qrtn.qc b/server/qrtn.qc index 88b209e8..ec9cbe31 100644 --- a/server/qrtn.qc +++ b/server/qrtn.qc @@ -434,15 +434,18 @@ sms_verify_query(cl, q, argc, argv_ro) register struct validate *v = q->validate; register int i; register int privileged = 0; + int len; /* copy the arguments into a local argv that we can modify */ if (argc >= QMAXARGS) return(SMS_ARGS); for (i = 0; i < argc; i++) { - if (strlen(argv_ro[i]) < ARGLEN) + if ((len = strlen(argv_ro[i])) < ARGLEN) strcpy(Argv[i], argv_ro[i]); else return(SMS_ARG_TOO_LONG); + if (Argv[i][len-1] == '\\') + return(SMS_BAD_CHAR); } /* check initial query access */