From 4771b91d516f6946673d4d8e6135f5a596a1dd9b Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 23 May 2012 18:18:10 +0100 Subject: [PATCH] ptsave protocol ptsave:#~, only ID is read, it must be the last argument (all arguments after ptsave are ignored for safety reason to prevent injecting other arguments links. --- src/main.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index ee7f6c227..b61627321 100644 --- a/src/main.c +++ b/src/main.c @@ -814,12 +814,12 @@ int main(int argc, char *argv[]) for (i=1; i=48 && tempString[ci]<=57) + { + tempNumberString[ns++] = tempString[ci]; + tempNumberString[ns] = 0; + } + else if(tempString[ci]=='#') + { + okay = 1; + break; + } + else + { + puts("ptsave: invalid save ID"); + break; + } + ci++; + } + if(!tempString[ci]) + { + break; + okay = 1; + } + if(okay) + { + tempSaveID = atoi(tempNumberString); + } + } + if(tempSaveID > 0) + { + puts("Got ptsave:id"); + saveURIOpen = tempSaveID; + } + break; + } } make_kernel();