[srvx-bugs] [ srvx-Bugs-870346 ] MemoServ - check if a memoid is numeric
Brought to you by:
entrope
From: SourceForge.net <no...@so...> - 2004-01-04 13:04:21
|
Bugs item #870346, was opened at 2004-01-04 14:04 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403001&aid=870346&group_id=31654 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Martijn Smit (detsaw) Assigned to: Nobody/Anonymous (nobody) Summary: MemoServ - check if a memoid is numeric Initial Comment: [Syndicate]: example being : [Syndicate]: [ 01:35 ] [M] You have a new message from Stekeltje. [Syndicate]: [ 01:35 ] [M] #0 From R`Giggs, received on 03:48 PM, 12/18/2003: [Syndicate]: [ 01:35 ] [M] #1 From Stekeltje, received on 01:35 PM, 01/04/2004: [Syndicate]: then I do [Syndicate]: > /memoserv delete #1 [Syndicate]: [ 01:35 ] [M] Memo 0 deleted. [Syndicate]: > /memoserv list [Syndicate]: [ 01:35 ] [M] ID From Time Sent [Syndicate]: [ 01:35 ] [M] 0 Stekeltje 01:35 PM, 01/04/2004 [Syndicate]: [ 01:35 ] [M] Found 1 matches. If the memoid is supplied as #1, atoi() generates a 0, and deletes memoid 0. Possible fix; ... #define MSMSG_INVALID_MEMOID "$b%s$b is an invalid memo-id." ... unsigned int i; for(i = 0; i < strlen(argv[1]); i++) { if(!isdigit((int)argv[1][i])) { memoserv_notice(user, MSMSG_INVALID_MEMOID, argv[1]); return 0; } } memoid = atoi(argv[1]); if (memoid >= ma->recvd.used) { .... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403001&aid=870346&group_id=31654 |